-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove supabase dependency #9
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3eb2ec4
to
df51909
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to spread the feedback object. Pass it directly.
...feedback, | |
feedback, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this is a hack to get the page to close.
} | ||
setIsFeedbackSubmitted(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to do this if the db isn't initialised
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the only way that the page closes
646593a
to
b3b752f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in. we'll fix the nits in a later pr
No description provided.