From 37e39571302cd3a59ba052b1088309d675ba090e Mon Sep 17 00:00:00 2001 From: jusax23 Date: Fri, 24 Mar 2023 21:09:25 +0100 Subject: [PATCH] fixes --- src/api/acts/roomContent.ts | 6 +++--- src/api/acts/rooms.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/acts/roomContent.ts b/src/api/acts/roomContent.ts index 35ec544..1f31729 100644 --- a/src/api/acts/roomContent.ts +++ b/src/api/acts/roomContent.ts @@ -13,7 +13,7 @@ export const getCategories: Act = { func: async (client: Client, data: any, aws: (code: string, data: any) => void) => { if (!checkSelfTag(data.server)) { if (client.state != STATE.client) return void aws("error", "right"); - let resp = await client.pass(data.server, "listCategories", data); + let resp = await client.pass(data.server, "getCategories", data); aws(resp.state, resp.data); return; } @@ -41,7 +41,7 @@ export const getCategories: Act = { } }; -export const changeCategories: Act = { +export const changeCategory: Act = { state: STATE.client | STATE.remote, right: 0, data: { @@ -54,7 +54,7 @@ export const changeCategories: Act = { func: async (client: Client, data: any, aws: (code: string, data: any) => void) => { if (!checkSelfTag(data.server)) { if (client.state != STATE.client) return void aws("error", "right"); - let resp = await client.pass(data.server, "changeCategories", data); + let resp = await client.pass(data.server, "changeCategory", data); aws(resp.state, resp.data); return; } diff --git a/src/api/acts/rooms.ts b/src/api/acts/rooms.ts index bdadd57..168a3c7 100644 --- a/src/api/acts/rooms.ts +++ b/src/api/acts/rooms.ts @@ -434,7 +434,7 @@ export const kickMember: Act = { server: "string", }, func: async (client: Client, data: any, aws: (code: string, data: any) => void) => { - if (!checkSelfTag(data.server)) { + if (!checkSelfTag(data.roomServer)) { if (client.state != STATE.client) return void aws("error", "right"); let resp = await client.pass(data.server, "kickMember", data); aws(resp.state, resp.data); @@ -446,7 +446,7 @@ export const kickMember: Act = { .where(and( eq(roomMembers.roomID, roomID), eq(roomMembers.name, data.name), - eq(roomMembers.server, data.server), + eq(roomMembers.server, checkSelfTag(data.server) ? "local" : data.server), or( not(eq(roomMembers.server, "local")), not(exists(