chore(release): 0.4.0
This commit is contained in:
@@ -28,10 +28,15 @@ export const userRepo = {
|
||||
return prisma.user.create({ data });
|
||||
},
|
||||
|
||||
/**
|
||||
* Tandai user sudah accept T&C/Privacy. Idempotent: kalau sudah `true`,
|
||||
* tidak overwrite `acceptedAt` (audit trail pertama tetap akurat).
|
||||
*/
|
||||
async markAcceptedTerms(id: string) {
|
||||
return prisma.user.update({
|
||||
where: { id },
|
||||
const result = await prisma.user.updateMany({
|
||||
where: { id, acceptedTermsAndPrivacy: false },
|
||||
data: { acceptedTermsAndPrivacy: true, acceptedAt: new Date() },
|
||||
});
|
||||
return { updated: result.count > 0 };
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user