AfterClass-io / afterclass.io-v2

[alpha] v2 of https://afterclass.io!
https://afterclass-io.vercel.app
MIT License
5 stars 2 forks source link

[BE] API Endpoint for creating Reviews #71

Closed davidlhw closed 4 months ago

davidlhw commented 6 months ago

Features

An endpoint to retrieve reviews with pagination

Core

retrieve a list of reviews, given trpc input like

input(
  z.object({
    body: z.string(),
    tips: z.string().optional(),
    rating: z.number(),
    reviewedUniversityId: z.number(),
    reviewedCourseId: z.string(),
    reviewedProfessorId: z.string().optional(),
    reviewerId: z.string(),
    reviewLabelIds: z.array(z.number()).optional(),
  }),
)

Implementation

This should be a private procedure and requires users to be signed in to be able to retrieve reviews.

Potential Issues

trpc protected procedures - see documentation for implementation example and details