fix(intern): menerapkan fallback posisi intern ke snapshot tabal user
This commit is contained in:
@@ -124,8 +124,13 @@ class AuthService {
|
||||
}
|
||||
|
||||
const { password, ...userWithoutPassword } = user;
|
||||
const lowongan = user.lamaran_magang?.lowongan_magang;
|
||||
|
||||
return data(userWithoutPassword);
|
||||
return data({
|
||||
...userWithoutPassword,
|
||||
position: lowongan?.posisi || user.intern_position || null,
|
||||
kelompok_peminatan: lowongan?.kelompok_peminatan || user.intern_interest_group || null,
|
||||
});
|
||||
} else {
|
||||
return error(new NotFoundError('Role tidak valid'));
|
||||
}
|
||||
@@ -262,7 +267,13 @@ class AuthService {
|
||||
});
|
||||
|
||||
const { password: _, ...userWithoutPassword } = updatedUser;
|
||||
return data(userWithoutPassword);
|
||||
const lowongan = updatedUser.lamaran_magang?.lowongan_magang;
|
||||
|
||||
return data({
|
||||
...userWithoutPassword,
|
||||
position: lowongan?.posisi || updatedUser.intern_position || null,
|
||||
kelompok_peminatan: lowongan?.kelompok_peminatan || updatedUser.intern_interest_group || null,
|
||||
});
|
||||
} else {
|
||||
if (imageFile?.filename) {
|
||||
const { deleteFileIfExists } = require('../../../helpers/utils/fileHelper');
|
||||
|
||||
Reference in New Issue
Block a user