diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index e6bd036012..562d350075 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -35,6 +35,11 @@ export const meta = { code: 'NOT_REMOTE', id: '4362f8dc-731f-4ad8-a694-be2a88922a24', }, + adminForbidden: { + message: 'Adminds cant migrate.', + code: 'NOT_ADMIN_FORBIDDEN', + id: '4362e8dc-731f-4ad8-a694-be2a88922a24', + }, }, } as const; @@ -49,6 +54,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { if (!ps.moveToAccount) throw new ApiError(meta.errors.noSuchMoveTarget); + if(user.isAdmin) throw new ApiError(meta.errors.adminForbidden); let unfiltered: string = ps.moveToAccount; diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index da34f3c8da..68c04ff229 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -78,6 +78,12 @@ export const meta = { code: 'YOU_HAVE_BEEN_BLOCKED', id: 'b390d7e1-8a5e-46ed-b625-06271cafd3d3', }, + + accountLocked: { + message: 'You migrated. Your account is now locked.', + code: 'ACCOUNT_LOCKED', + id: 'd390d7e1-8a5e-46ed-b625-06271cafd3d3', + }, }, } as const; @@ -163,6 +169,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { + if(user.movedToUri) throw new ApiError(meta.errors.accountLocked); let visibleUsers: User[] = []; if (ps.visibleUserIds) { visibleUsers = await Users.findBy({