decomp.me icon indicating copy to clipboard operation
decomp.me copied to clipboard

Split out `api.ts` into client vs server functions

Open mkst opened this issue 1 year ago • 1 comments

Because we are doing useEffect in the api.ts, we have to use client to ensure all code runs on the client-side. There are functions that could (should?) run on the server side.

Describe the solution you'd like Split the api file into api_client/api_server, and use the server functions where appropriate

Describe alternatives you've considered I might be using it wrong.

mkst avatar Mar 09 '24 15:03 mkst

This would require a rewrite of almost all of the api's that you want to be used in the server side. As almost all of them implement functionality that requires rendering on the client side (useSWR, useEffect, useRouter). I think that it would be most helpful to identify the api's that "need" to be rendered in the client side because we need to do more than just split the file.

conorgolden1 avatar May 02 '24 19:05 conorgolden1