mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(database): 🐛 Fix incorrect column name used in queries
This commit is contained in:
parent
972ced1f10
commit
ffc45c5869
|
|
@ -57,7 +57,7 @@ export default apiRoute<typeof meta, typeof schema>(
|
|||
max_id ? lt(follower.id, max_id) : undefined,
|
||||
since_id ? gte(follower.id, since_id) : undefined,
|
||||
min_id ? gt(follower.id, min_id) : undefined,
|
||||
sql`EXISTS (SELECT 1 FROM "Relationship" WHERE "Relationship"."subjectId" = ${otherUser.id} AND "Relationship"."objectId" = ${follower.id} AND "Relationship"."following" = true)`,
|
||||
sql`EXISTS (SELECT 1 FROM "Relationship" WHERE "Relationship"."subjectId" = ${otherUser.id} AND "Relationship"."ownerId" = ${follower.id} AND "Relationship"."following" = true)`,
|
||||
),
|
||||
// @ts-expect-error Yes I KNOW the types are wrong
|
||||
orderBy: (liker, { desc }) => desc(liker.id),
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export default apiRoute<typeof meta, typeof schema>(
|
|||
max_id ? lt(following.id, max_id) : undefined,
|
||||
since_id ? gte(following.id, since_id) : undefined,
|
||||
min_id ? gt(following.id, min_id) : undefined,
|
||||
sql`EXISTS (SELECT 1 FROM "Relationship" WHERE "Relationship"."subjectId" = ${following.id} AND "Relationship"."objectId" = ${otherUser.id} AND "Relationship"."following" = true)`,
|
||||
sql`EXISTS (SELECT 1 FROM "Relationship" WHERE "Relationship"."subjectId" = ${following.id} AND "Relationship"."ownerId" = ${otherUser.id} AND "Relationship"."following" = true)`,
|
||||
),
|
||||
// @ts-expect-error Yes I KNOW the types are wrong
|
||||
orderBy: (liker, { desc }) => desc(liker.id),
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ export default apiRoute<typeof meta, typeof schema>(
|
|||
self?.id
|
||||
} AND Relationships.following = ${
|
||||
following ? true : false
|
||||
} AND Relationships.objectId = ${user.id})`
|
||||
} AND Relationships.ownerId = ${user.id})`
|
||||
: undefined,
|
||||
),
|
||||
orderBy: (user, { desc }) => desc(user.createdAt),
|
||||
|
|
@ -191,7 +191,7 @@ export default apiRoute<typeof meta, typeof schema>(
|
|||
self?.id
|
||||
} AND Relationships.following = ${
|
||||
following ? true : false
|
||||
} AND Relationships.objectId = ${status.authorId})`
|
||||
} AND Relationships.ownerId = ${status.authorId})`
|
||||
: undefined,
|
||||
),
|
||||
orderBy: (status, { desc }) => desc(status.createdAt),
|
||||
|
|
|
|||
Loading…
Reference in a new issue