[question][ui] integrate backend voting (#355)

Co-authored-by: wlren <weilinwork99@gmail.com>
This commit is contained in:
Jeff Sieu
2022-10-10 22:23:58 +08:00
committed by GitHub
parent 7052e8c175
commit 50d3386592
25 changed files with 639 additions and 382 deletions

View File

@ -335,7 +335,7 @@ export const questionsQuestionRouter = createProtectedRouter()
},
});
if (voteToUpdate?.id !== userId) {
if (voteToUpdate?.userId !== userId) {
throw new TRPCError({
code: 'UNAUTHORIZED',
message: 'User have no authorization to record.',
@ -365,7 +365,7 @@ export const questionsQuestionRouter = createProtectedRouter()
},
});
if (voteToDelete?.id !== userId) {
if (voteToDelete?.userId !== userId) {
throw new TRPCError({
code: 'UNAUTHORIZED',
message: 'User have no authorization to record.',