1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 13:29:22 +00:00

Fix little issue

This commit is contained in:
Pierre HUBERT 2019-11-23 20:54:35 +01:00
parent 601c416975
commit c28206e5c0
2 changed files with 3 additions and 2 deletions

View File

@ -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) !!");

View File

@ -55,7 +55,7 @@ export class ConversationsHelper {
*
* @param convID The ID of the conversation to get
*/
public static async GetSingle(convID : number) : Promise<Conversation | null> {
public static async GetSingle(convID : number, userID: number) : Promise<Conversation | null> {
const result = await DatabaseHelper.QueryRow({
fields: [
"*",
@ -72,6 +72,7 @@ export class ConversationsHelper {
],
where: {
"l.id": convID,
"u.user_id": userID
}
});