icssc / AntAlmanac

A course exploration and scheduling tool for UCI Anteaters
https://antalmanac.com
MIT License
54 stars 64 forks source link

fix: Update Arktype for Buildings #814

Closed KevinWu098 closed 9 months ago

KevinWu098 commented 9 months ago

Summary

The Arktype definition for undefined is a little more specific than what we currently have:

const schema = type({ 'building?': 'string' })

It should instead be:

const schema = type({ 'building?': 'string | undefined' })

Test Plan

  1. Can schedules with custom events that don't have selected buildings be saved?
  2. Check if this change broke anything else; Good places to look would be export, creating, editing, copying, etc.

Issues

Bug report from feedback

ap0nia commented 9 months ago

Force this to deploy the backend. It's the only relevant part that needs to be updated.

KevinWu098 commented 9 months ago

If you look at the deployment, it will error out, but there's no schema issue so it should (the word should is doing heavy lifting here) work on prod

KevinWu098 commented 9 months ago

@ap0nia Could you take a cursory glance and approve?

Worst comes to worst it fails and we go from fail -> fail

ap0nia commented 9 months ago

Could you write the test case I mentioned? I think it would be helpful for documenting the history of buildings. i.e. "It must be optional and string | undefined because of these reasons, and this test ensures that"

KevinWu098 commented 9 months ago

Could you write the test case I mentioned? I think it would be helpful for documenting the history of buildings. i.e. "It must be optional and string | undefined because of these reasons, and this test ensures that"

Sure @ap0nia; Do you think that should be a new test file or should that be in one of the existing?

ap0nia commented 9 months ago

You can make a new file because this is a somewhat miscellaneous test.