diff --git a/src/_staart/helpers/utils.ts b/src/_staart/helpers/utils.ts index 5a0998374..6d6c4388e 100644 --- a/src/_staart/helpers/utils.ts +++ b/src/_staart/helpers/utils.ts @@ -102,7 +102,7 @@ export const IdValues = [ "id", "userId", "groupId", - "primaryEmail", + "prefersEmailId", "apiKeyId", "apiKeyGroupId", ]; diff --git a/src/_staart/services/user.service.ts b/src/_staart/services/user.service.ts index aa907d4a3..02ee0d57b 100644 --- a/src/_staart/services/user.service.ts +++ b/src/_staart/services/user.service.ts @@ -73,10 +73,10 @@ export const updateUser = async (id: number, user: KeyValue) => { const originalUser = await getUserById(id); await deleteItemFromCache(`cache_getUserById_${originalUser.id}`); if (user.password) user.password = await hash(user.password, 8); - if (user.primaryEmail) { + if (user.prefersEmailId) { if ((originalUser.profilePictureUrl || "").includes("api.adorable.io")) { const emailDetails = await prisma.emails.findOne({ - where: { id: user.primaryEmail }, + where: { id: user.prefersEmailId }, }); if (emailDetails) user.profilePicture = `https://www.gravatar.com/avatar/${createHash( diff --git a/src/controllers/users/_id/index.ts b/src/controllers/users/_id/index.ts index da52e1f06..30468b172 100644 --- a/src/controllers/users/_id/index.ts +++ b/src/controllers/users/_id/index.ts @@ -34,7 +34,7 @@ export class UserController { .min(3) .regex(/^[a-zA-Z ]*$/), nickname: Joi.string(), - primaryEmail: [Joi.string(), Joi.number()], + prefersEmailId: [Joi.string(), Joi.number()], countryCode: Joi.string().length(2), password: Joi.string().min(6), gender: Joi.string() diff --git a/src/rest/index.ts b/src/rest/index.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/services/index.ts b/src/services/index.ts new file mode 100644 index 000000000..e69de29bb