62 feat legg til vurderinger av annonser #78
Merged
+2,483
−71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Closes #62
Endringer
reviewsmed fremmednøkkel tillistings(ON DELETE CASCADE),CHECKpå score 1–5 og kommentar ≤ 500 tegn, og indeks på(listing_id, created_at DESC, id DESC).Listinghar fåttaverageScore,reviewCountogreviews(limit: Int = 10). Snitt og antall regnes ut medCROSS JOIN LATERALbare for annonsene som returneres, uten N+1.createReview(input)validerer score og kommentar på serveren og svarer med vurderingen og annonsen med oppdatert snitt og liste. Ukjent annonse gir «Fant ikke annonsen.»npm run seed.Verdt å se på:
docs/vurderinger.mdbeskriver valgene, og hva som mangler uten innlogging.Testing
npm run typechecknpm run lintnpm run format:checknpm test(frontend 283, backend 161 mot testdatabase)npm run buildNye tester:
reviews.api.test.ts,createReviewInput.test.ts,ReviewForm,ReviewList,ReviewScore,reviewForm.test.ts,reviewFormat.test.ts, og vurderinger iApp.test.tsx.Migrasjonen er kjørt opp, ned og opp igjen lokalt. På VM-en kjøres
npm run migrate(og eventueltnpm run seed) i #68.Sjekkliste
docs/er oppdatert hvis det trengs