Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 519 question match words #316

Merged
merged 23 commits into from
Dec 30, 2024

Conversation

mateuszszczecina
Copy link
Collaborator

Jira issue(s)

https://selleolabs.atlassian.net/browse/LC-519

Overview

Add new quiz type -> match words

@mateuszszczecina mateuszszczecina added the review me 👀 PR is ready to be reviewed label Dec 30, 2024
@mateuszszczecina mateuszszczecina self-assigned this Dec 30, 2024
Copy link
Collaborator

@wielopolski wielopolski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ 🥇

.where(eq(questions.lessonId, lessonId));
}

async upsertOptions(questionId: UUIDType) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not a upsert method

.where(inArray(questionAnswerOptions.questionId, questionsToDelete));
}

async upsertQuestion(questionData: QuestionBody, lessonId: UUIDType, authorId: UUIDType, questionId?: UUIDType): Promise<UUIDType> {
Copy link
Collaborator

@wielopolski wielopolski Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe can we use drizzle upsert to do it?

await db.insert(users)
.values({ id: 1, name: 'Dan' })
.onConflictDoUpdate({ target: users.id, set: { name: 'John' } });

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with extracted DB methods to Repository, but I think that we need to use trx and provide it to call of method

Copy link
Collaborator

@wielopolski wielopolski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🍻

@mateuszszczecina mateuszszczecina merged commit 084790c into main Dec 30, 2024
4 of 6 checks passed
@mateuszszczecina mateuszszczecina deleted the ms_feat_519_question_match_words_type branch December 30, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me 👀 PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants