diff --git a/database/entities/User.ts b/database/entities/User.ts index 4b07daf9..72a546a1 100644 --- a/database/entities/User.ts +++ b/database/entities/User.ts @@ -71,17 +71,6 @@ export const followRequestUser = async ( ) => { const isRemote = follower.instanceId !== followee.instanceId; - const relationship = await client.relationship.update({ - where: { id: relationshipId }, - data: { - following: isRemote ? false : !followee.isLocked, - requested: isRemote ? true : followee.isLocked, - showingReblogs: reblogs, - notifying: notify, - languages: languages, - }, - }); - if (isRemote) { // Federate // TODO: Make database job @@ -120,6 +109,17 @@ export const followRequestUser = async ( } } + const relationship = await client.relationship.update({ + where: { id: relationshipId }, + data: { + following: isRemote ? false : !followee.isLocked, + requested: isRemote ? true : followee.isLocked, + showingReblogs: reblogs, + notifying: notify, + languages: languages, + }, + }); + return relationship; }; diff --git a/server/api/api/v1/accounts/lookup/index.ts b/server/api/api/v1/accounts/lookup/index.ts index 76cd18cb..21f709a1 100644 --- a/server/api/api/v1/accounts/lookup/index.ts +++ b/server/api/api/v1/accounts/lookup/index.ts @@ -68,5 +68,5 @@ export default apiRoute<{ return jsonResponse(userToAPI(account)); } - return errorResponse(`Account with username ${username} not found"`, 404); + return errorResponse(`Account with username ${username} not found`, 404); });