Astro recently added this API to create type-safe actions that are also SSR/no-js friendly. Look into our current API and see where this can replace existing endpoints
Stuff to replace
Anything to do with trades
The open-packs page
A bunch of stuff on the admin site
Questions:
How will this work with auth?
probably the same way we handle auth in Astro rn, i.e. check the session type and redirect if needed
Can probably make a generic function to handle auth stuff
Strategies:
Organize actions in the src/actions directory in files based on the domain. E.G.
actions/users.ts
actions/designs.ts
actions/trades.ts
actions/open-packs.ts
Concerns:
Are we sharing endpoints between main and admin sites? If so, moving to actions would cause some duplication
counterpoint: if there are shared endpoints, they may have slightly different requirements that we can account for in the action instead of one generic endpoint
https://docs.astro.build/en/guides/actions/
Astro recently added this API to create type-safe actions that are also SSR/no-js friendly. Look into our current API and see where this can replace existing endpoints
Stuff to replace
Questions:
Strategies:
Organize actions in the
src/actions
directory in files based on the domain. E.G.actions/users.ts
actions/designs.ts
actions/trades.ts
actions/open-packs.ts
Concerns: