fix(lamaran): reuse akun intern yang sudah ada dan update data ke lamaran magang terbaru
This commit is contained in:
@@ -237,13 +237,21 @@ class LamaranMagangService {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const { nama_depan, nama_belakang } = checkResult.data.mahasiswa;
|
||||
const fullName = [nama_depan, nama_belakang].filter(Boolean).join(" ");
|
||||
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: existingUser.id,
|
||||
},
|
||||
data: {
|
||||
intern_position: existingUser.intern_position || internPosition,
|
||||
intern_interest_group:existingUser.intern_interest_group || internInterestGroup,
|
||||
id_mahasiswa: checkResult.data.id_mahasiswa,
|
||||
id_lamaran_magang: parseInt(id_lamaran_magang),
|
||||
full_name: fullName,
|
||||
email: checkResult.data.mahasiswa.email,
|
||||
intern_position: internPosition,
|
||||
intern_interest_group: internInterestGroup,
|
||||
is_active: true
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user