Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3eb2ec4 to
df51909
Compare
Extheoisah
left a comment
There was a problem hiding this comment.
Looks good. Just a few comments.
|
|
||
| export const addFeedback = async (feedback: FeedbackPayload, feedbackId: string) => { | ||
| const { status, error } = await SupaBaseDatabase.getInstance().addFeedback({ | ||
| ...feedback, |
There was a problem hiding this comment.
No need to spread the feedback object. Pass it directly.
| ...feedback, | |
| feedback, |
There was a problem hiding this comment.
I get this from my linter when I change to your suggestion:
Argument of type '{ feedback: FeedbackPayload; feedbackId: string; }' is not assignable to parameter of type 'FeedbackPayload'. Object literal may only specify known properties, but 'feedback' does not exist in type 'FeedbackPayload'. Did you mean to write 'feedbackId'?ts(2345)
There was a problem hiding this comment.
Okay. its a type issue but this is fine too
| setIsFeedbackSubmitted(true); | ||
| console.log("Feedback sent successfully"); | ||
| if (isSupabaseInitialized) { | ||
| await addFeedback(feedback, feedbackId); |
There was a problem hiding this comment.
Since this function returns true or false, we should assign the return value a variable and check if the feedback was submitted. Only then should we setFeedBackSubmitted to true
There was a problem hiding this comment.
yeah, this is a hack to get the page to close.
| } else { | ||
| console.error('Cannot submit rating because supabase is not initialized'); | ||
| } | ||
| setIsFeedbackSubmitted(true); |
There was a problem hiding this comment.
We don't want to do this if the db isn't initialised
There was a problem hiding this comment.
it's the only way that the page closes
646593a to
b3b752f
Compare
Extheoisah
left a comment
There was a problem hiding this comment.
Let's get this in. we'll fix the nits in a later pr
No description provided.