diff --git a/src/controllers/ConversationsController.ts b/src/controllers/ConversationsController.ts index 0081c5e..365db81 100644 --- a/src/controllers/ConversationsController.ts +++ b/src/controllers/ConversationsController.ts @@ -27,7 +27,7 @@ export class ConversationsController { */ public static async GetInfoSingle(handler: RequestHandler) { const conversationID = await this.GetPostConversationId("conversationID", handler); - const conv = await ConversationsHelper.GetSingle(conversationID); + const conv = await ConversationsHelper.GetSingle(conversationID, handler.getUserId()); if(!conv) throw Error("Could not get information about the conversation (but it should have been found though) !!"); diff --git a/src/helpers/ConversationsHelper.ts b/src/helpers/ConversationsHelper.ts index abd0a71..be7cfd2 100644 --- a/src/helpers/ConversationsHelper.ts +++ b/src/helpers/ConversationsHelper.ts @@ -55,7 +55,7 @@ export class ConversationsHelper { * * @param convID The ID of the conversation to get */ - public static async GetSingle(convID : number) : Promise { + public static async GetSingle(convID : number, userID: number) : Promise { const result = await DatabaseHelper.QueryRow({ fields: [ "*", @@ -72,6 +72,7 @@ export class ConversationsHelper { ], where: { "l.id": convID, + "u.user_id": userID } });