Skip to content

Commit

Permalink
can create reviews now lool
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsunyt committed Mar 28, 2024
1 parent 08bb439 commit a3f3414
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
19 changes: 19 additions & 0 deletions backend/ohq/migrations/0002_alter_review_question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2.7 on 2024-03-28 00:52

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('ohq', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='review',
name='question',
field=models.OneToOneField(blank=True, on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='review', serialize=False, to='ohq.question'),
),
]
6 changes: 3 additions & 3 deletions backend/ohq/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
QueueStatistic,
Semester,
Tag,
Review
Review,
)
from ohq.pagination import QuestionSearchPagination
from ohq.permissions import (
Expand All @@ -63,7 +63,7 @@
QueuePermission,
QueueStatisticPermission,
TagPermission,
ReviewPermission
ReviewPermission,
)
from ohq.schemas import EventSchema, MassInviteSchema, OccurrenceSchema
from ohq.serializers import (
Expand All @@ -82,7 +82,7 @@
SemesterSerializer,
TagSerializer,
UserPrivateSerializer,
ReviewSerializer
ReviewSerializer,
)
from ohq.sms import sendSMSVerification

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const LastQuestionCard = ({
await createReview(courseId, queueId, question.id, {
rating: reviewRating,
content: reviewText,
question: question.id,
});
setSubmittedFeedback(true);
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/hooks/data-fetching/tareviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function createReview(
courseId: number,
queueId: number,
questionId: number,
payload: { rating: number; content: string }
payload: { rating: number; content: string; question: number }
) {
const res = await doApiRequest(
`/api/courses/${courseId}/queues/${queueId}/questions/${questionId}/review/`,
Expand Down

0 comments on commit a3f3414

Please sign in to comment.