fmeyjr
Empty response in pinia store from server API using $fetch
On a server route
server/api/offices/index.post.ts
, supabase is (successfully) used to update an "office". We are returning this office on the server route.
In the office pinia store, we use this method to add the office via the server:
However, the data
does not contain the added office and is just an empty object.
The fetching of offices with $fetch and callOnce does work as expected. We have applied the suggestions from this awesome video: https://www.youtube.com/watch?v=njsGVmcWviY
What are we doing wrong? If anyone has an example with pinia + CRUD server API, it would be awesome to share it with us 🙏7 replies