clemsonMakerspace / unified-makerspace

The Makerspace - now unified.
Apache License 2.0
8 stars 11 forks source link

Majors appear as [{"S":"Mechanical Engineering"}] #90

Open tea-jazz opened 2 years ago

tea-jazz commented 2 years ago

Majors on the downloaded dynamoDB csv is displayed as the following format [{"S":"Mechanical Engineering"}]. This issue began appearing this way on 2/23/2022 was fine on 2/22/2022 if this is helpful.

Mjtlittle commented 2 years ago

I introduced this bug when I was changing the registration logic on the frontend. I had assumed the backend was accepting an array of strings for the Major and Minor fields, but it instead takes a comma delineated string of all of the majors and minors.

The sent json before the change I made...

{
     "Majors": "a,b,c,d"
}

compared to how it is now...

{
     "Majors": ["a", "b", "c", "d"]
}

which gets stored according to how dynamodb translates it to a string, [{"S":"a"},{"S":"b"},{"S":"c"},{"S":"d"}]; instead of the a,b,c,d it would have before.

tea-jazz commented 2 years ago

Thank you! From what I see and your explanation it looks good. Can we merge this soon?

Mjtlittle commented 2 years ago

I just opened a PR for this change (#98). There may be a better solution to this problem, but reverting to the prior functionality is sufficient for now.