feat: add grammar check functionality and enhance quiz schema

- Introduced a new 'testCheckGrammar' field in DocumentSchema to facilitate grammar checking for documents, leveraging the document service for processing.
- Updated DocumentService to implement grammar checking logic, including caching results and publishing suggestions.
- Enhanced QuizSchema by adding filter arguments for quiz attempts, allowing for more flexible data retrieval based on user and quiz IDs.
- Cleaned up whitespace and improved error handling in quiz attempt creation to ensure better user feedback.

These changes improve the document editing experience and enhance the quiz feature's data handling capabilities.
This commit is contained in:
2024-12-11 22:36:35 +07:00
parent 4168bff1e8
commit 3652fda7d3
7 changed files with 72 additions and 43 deletions

View File

@@ -266,7 +266,6 @@ export class ScheduleSchema extends PothosSchema {
if (!ctx.http?.me?.id) {
throw new Error('User not found')
}
Logger.log(`ctx.http.me.role: ${ctx.http.me.role}`)
// use case 1: customer query schedules where customer is participant
if (ctx.http.me.role === Role.CUSTOMER) {
const schedules = await this.prisma.schedule.findMany({