🚩 create basic flow for fetching user data

This commit is contained in:
Rafi Arrafif
2025-07-17 23:20:00 +07:00
parent 30806e23e0
commit 9bc1b592d0
5 changed files with 58 additions and 12 deletions

View File

@ -9,6 +9,34 @@ export const findUserByEmailRepository = async (
where: {
email,
},
omit: {},
select: {
id: options.verbosity?.includes("full"),
name: ["full", "basic"].some((level) =>
options.verbosity?.includes(level)
),
username: ["full", "basic"].some((level) =>
options.verbosity?.includes(level)
),
email: options.verbosity?.includes("full"),
password: options.verbosity?.includes("full"),
birthDate: options.verbosity?.includes("full"),
gender: options.verbosity?.includes("full"),
phoneCC: options.verbosity?.includes("full"),
phoneNumber: options.verbosity?.includes("full"),
bioProfile: ["full", "basic"].some((level) =>
options.verbosity?.includes(level)
),
avatar: ["full", "basic"].some((level) =>
options.verbosity?.includes(level)
),
commentBackground: ["full", "basic"].some((level) =>
options.verbosity?.includes(level)
),
preferenceId: options.verbosity?.includes("full"),
verifiedAt: options.verbosity?.includes("full"),
disabledAt: options.verbosity?.includes("full"),
createdAt: options.verbosity?.includes("full"),
updatedAt: options.verbosity?.includes("full"),
},
});
};