return UserNotFound error if user does not exist in delete account trx
This commit is contained in:
@ -368,7 +368,13 @@ export const deleteAccountResolver = authorized<
|
||||
>(async (_, { userID }, { models, claims, log, authTrx }) => {
|
||||
const user = await models.user.get(userID)
|
||||
|
||||
if (!user || user.id !== claims.uid) {
|
||||
if (!user) {
|
||||
return {
|
||||
errorCodes: [DeleteAccountErrorCode.UserNotFound],
|
||||
}
|
||||
}
|
||||
|
||||
if (user.id !== claims.uid) {
|
||||
return {
|
||||
errorCodes: [DeleteAccountErrorCode.Unauthorized],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user