Fixes for wrong follows

This commit is contained in:
Jesse Wierzbinski 2024-04-08 16:26:48 -10:00
parent 6c60191ab2
commit 8bda61e099
No known key found for this signature in database
3 changed files with 7 additions and 3 deletions

View file

@ -63,12 +63,13 @@ export const getFromRequest = async (req: Request): Promise<AuthData> => {
export const followUser = async (
follower: User,
followee: User,
relationshipId: string,
reblogs = false,
notify = false,
languages: string[] = [],
) => {
const relationship = await client.relationship.update({
where: { id: follower.id },
where: { id: relationshipId },
data: {
following: true,
showingReblogs: reblogs,
@ -96,12 +97,13 @@ export const followUser = async (
export const followRequestUser = async (
follower: User,
followee: User,
relationshipId: string,
reblogs = false,
notify = false,
languages: string[] = [],
) => {
const relationship = await client.relationship.update({
where: { id: follower.id },
where: { id: relationshipId },
data: {
requested: true,
showingReblogs: reblogs,

View file

@ -62,6 +62,7 @@ export default apiRoute<{
relationship = await followRequestUser(
self,
user,
relationship.id,
reblogs,
notify,
languages,
@ -70,6 +71,7 @@ export default apiRoute<{
relationship = await followUser(
self,
user,
relationship.id,
reblogs,
notify,
languages,

View file

@ -666,7 +666,7 @@ describe("API Tests", () => {
const account = (await response.json()) as APIAccount;
expect(account.id).toBeDefined();
expect(account.avatar).toBe("");
expect(account.avatar).toBeDefined();
});
});