Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

feat: inserting a question in a table #138

Closed
wants to merge 6 commits into from

Conversation

ykdojo
Copy link
Collaborator

@ykdojo ykdojo commented Aug 28, 2022

This PR depends on #136 and #137.

Once those two and this one are merged, #108 will be closed.

@vercel
Copy link

vercel bot commented Aug 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
defaang ✅ Ready (Inspect) Visit Preview Aug 28, 2022 at 6:53AM (UTC)

@ykdojo ykdojo changed the base branch from main to submit-question-backend-2 August 28, 2022 03:19
@ykdojo ykdojo changed the title Submit question backend 3 feat: inserting a question in a table Aug 28, 2022
@subhoghoshX
Copy link
Collaborator

I think you should open one PR at a time 🤣 I'm confused between #137 and #138

@ykdojo ykdojo marked this pull request as draft August 30, 2022 14:54
@ykdojo
Copy link
Collaborator Author

ykdojo commented Aug 30, 2022

@subhoghoshX haha ok I made this one into a draft

@iShibi iShibi added the feat New feature addition or request label Sep 5, 2022
@iShibi
Copy link
Contributor

iShibi commented Sep 6, 2022

@ykdojo I think we can insert questions from front-end, this will simplify quite a lot of stuff. I'll open a PR later today.

@ykdojo
Copy link
Collaborator Author

ykdojo commented Sep 6, 2022

@iShibi I actually explained my thought process behind this approach here. Mind taking a look? I think it's a nice, more simplified example than this PR.

const supabase = createClient(supabaseUrl, supabaseAnonKey);
const supabaseSecret = createClient(supabaseUrl, supabaseServiceKey);

export default async function handler(req, res) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export default async function handler(req, res) {
export default async function handler(req: NextApiRequest, res: NextApiResponse) {

Always nice to have :)

@@ -0,0 +1,41 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import { createClient, SupabaseClient } from '@supabase/supabase-js';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { NextApiRequest, NextApiResponse } from 'next';

@@ -97,21 +97,22 @@ const Submit: NextPage<UserProps> = ({ session }) => {
</div>

<div className='sm:col-span-3'>
<label htmlFor='recency' className='block text-sm font-medium text-gray-700'>
<label htmlFor='recency-weeks' className='block text-sm font-medium text-gray-700'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label htmlFor='recency-weeks' className='block text-sm font-medium text-gray-700'>
<label htmlFor='recency_weeks' className='block text-sm font-medium text-gray-700'>

change here also as you have done in the below fields.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@debasishbsws thank you but this is an old PR so I'll close it

Comment on lines +105 to +106
id='recency-weeks'
{...register('recency-weeks', { required: true })}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
id='recency-weeks'
{...register('recency-weeks', { required: true })}
id='recency_weeks'
{...register('recency_weeks', { required: true })}

@ykdojo ykdojo closed this Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat New feature addition or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants