From 61535d361d7b320c2220f9913909c128af56ca52 Mon Sep 17 00:00:00 2001 From: Jackson Chen <541898146chen@gmail.com> Date: Tue, 29 Oct 2024 00:28:05 -0500 Subject: [PATCH] refactor: Update message model and resolver to use MessageRole enum --- backend/src/chat/chat.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/chat/chat.service.ts b/backend/src/chat/chat.service.ts index 9172055..33d0444 100644 --- a/backend/src/chat/chat.service.ts +++ b/backend/src/chat/chat.service.ts @@ -1,7 +1,7 @@ import { Injectable, Logger } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { ChatCompletionChunk, Chat } from './chat.model'; -import { Message, Role } from 'src/chat/message.model'; +import { Message, MessageRole } from 'src/chat/message.model'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { User } from 'src/user/user.model'; @@ -278,7 +278,7 @@ export class ChatService { async saveMessage( chatId: string, messageContent: string, - role: Role, + role: MessageRole, ): Promise { // Find the chat instance const chat = await this.chatRepository.findOne({ where: { id: chatId } });