Skip to content

Conversation

@Lindsay-X
Copy link
Member

  • added form route test
  • added get all form route and get specific form route
  • get all form logic: returns an array of (formId, seasonCode, openTime, closeTime, and tags)
  • get specific form logic: returns formId, seasonCode, openTime, closeTime, tags, and responses based on formId in param
  • added test for service logic

.from(form)
.where(and(eq(form.seasonCode, seasonCode), eq(form.formId, formId)))
.limit(1);
const responses = await getFormResponses(seasonCode, formId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this was meant to get the questions right? not responses?

Copy link
Member Author

Choose a reason for hiding this comment

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

OH, ur right 💀 woops

const responses = await getFormResponses(seasonCode, formId);
return formResult[0]
? {
formId: formResult[0].formId,
Copy link
Contributor

@danielp1218 danielp1218 Jan 16, 2026

Choose a reason for hiding this comment

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

if you want you can do ...formResult[0] to just put in all the fields. the only other fields are formName (which should also be returned btw) and eventId (which im gonna remove in #12)

questions?: CreateFormQuestionInput[];
}

export const getForms = async (seasonCode: string, formId?: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: IMO this should be separated into 2 functions since it returns different types based on whether formId is provided (and since theres no shared logic).

@Lindsay-X Lindsay-X changed the title feat: added get form and get all form service feat: added get form and get all form service (NOT READY FOR REVIEW) Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants