mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
Fix broken lists
This commit is contained in:
parent
fa5f521976
commit
227c72b76a
@ -52,14 +52,12 @@ export const paramDef = {
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
// Fetch the list
|
||||
const listExists = await UserLists.exist({
|
||||
where: {
|
||||
const userList = await UserLists.findOneBy({
|
||||
id: ps.listId,
|
||||
userId: me.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!listExists) {
|
||||
if (!userList) {
|
||||
throw new ApiError(meta.errors.noSuchList);
|
||||
}
|
||||
|
||||
@ -85,7 +83,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
|
||||
const exist = await UserListJoinings.exist({
|
||||
where: {
|
||||
userListId: userList.id,
|
||||
userListId: ps.listId,
|
||||
userId: user.id,
|
||||
},
|
||||
});
|
||||
|
@ -37,14 +37,12 @@ export const paramDef = {
|
||||
|
||||
export default define(meta, paramDef, async (ps, me) => {
|
||||
// Fetch the list
|
||||
const exist = await UserLists.exist({
|
||||
where: {
|
||||
const userList = await UserLists.findOneBy({
|
||||
id: ps.listId,
|
||||
userId: me.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!exist) {
|
||||
if (!userList) {
|
||||
throw new ApiError(meta.errors.noSuchList);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user