mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Only mark as followed in database if federation works
This commit is contained in:
parent
5aeb50b7d5
commit
cb85b4a1de
|
|
@ -71,17 +71,6 @@ export const followRequestUser = async (
|
||||||
) => {
|
) => {
|
||||||
const isRemote = follower.instanceId !== followee.instanceId;
|
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) {
|
if (isRemote) {
|
||||||
// Federate
|
// Federate
|
||||||
// TODO: Make database job
|
// 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;
|
return relationship;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,5 +68,5 @@ export default apiRoute<{
|
||||||
return jsonResponse(userToAPI(account));
|
return jsonResponse(userToAPI(account));
|
||||||
}
|
}
|
||||||
|
|
||||||
return errorResponse(`Account with username ${username} not found"`, 404);
|
return errorResponse(`Account with username ${username} not found`, 404);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue