mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Fixes for wrong follows
This commit is contained in:
parent
6c60191ab2
commit
8bda61e099
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue