Syosset / syosset

🖥️ The official website of Syosset High School from 2017-2019, powered by Rails 5.
https://web.archive.org/web/20190414065933/https://syosseths.com/
MIT License
9 stars 2 forks source link

App still uses old day color endpoint #84

Closed kailan closed 6 years ago

kailan commented 6 years ago

@rlefkowitz Can you update your app to fetch the day color from https://syosseths.com/day instead of https://syosseths.com/day_color?

If you can update the issue when done so we can remove the old endpoint that'd be great 👍

rlefkowitz commented 6 years ago

I can get the update submitted by Monday, although I have to remove notifications temporarily due to some logistical issues with the developer account.

neiljohari commented 6 years ago

As of 91dd8fbb2fd76015f4f326590b46c865bd3ed2a1 the /day API is following a different format (legacy route remains unaffected). I've already informed @jweiss045, but it might be nice to have it documented here.

If I were you guys, instead of just ripping through the api output, I would implement a jsonapi deserializer. You can use our serializers as a reference for what data to extract.

Examples of what the new API returns: No School: {"data":{"id":"current_day_color","type":"days","attributes":{"color":"No Color"},"relationships":{"closure":{"data":null}}},"jsonapi":{"version":"1.0"}}

Red Day: {"data":{"id":"current_day_color","type":"days","attributes":{"color":"Red Day"},"relationships":{"closure":{"data":null}}},"jsonapi":{"version":"1.0"}}

White Day: {"data":{"id":"current_day_color","type":"days","attributes":{"color":"White Day"},"relationships":{"closure":{"data":null}}},"jsonapi":{"version":"1.0"}}

Active Closure: {"data":{"id":"current_day_color","type":"days","attributes":{"color":"No Color"},"relationships":{"closure":{"data":{"type":"closures","id":"5a4ec95f366a3530e7f41865"}}}},"included":[{"id":"5a4ec95f366a3530e7f41865","type":"closures","attributes":{"type":"snow","content":"This is due to the road and weather conditions. All activities will be cancelled including SCOPE.","start_date":"2018-01-03","end_date":"2018-01-04"}}],"jsonapi":{"version":"1.0"}}

note: whole API is heavily subject to change, especially right now that it's just being formed

jweiss0 commented 6 years ago

I have updated the Android version of the app with the new API.

neiljohari commented 6 years ago

@rlefkowitz @jweiss045 Are we good to remove the outdated endpoint now?

rlefkowitz commented 6 years ago

Yes, you can remove the endpoint now. 

On Sunday, January 14, 2018, 4:06 PM, Neil Johari notifications@github.com wrote:

@rlefkowitz @jweiss045 Are we good to remove the outdated endpoint now?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.