1
0
Fork 0
activist/src/stores/stickerStore.ts

25 lines
568 B
TypeScript
Raw Normal View History

2024-11-25 20:06:22 -05:00
import { defineStore } from 'pinia'
export const useStickerStore = defineStore('sticker', {
actions: {
async fetch(uuid: string) {
console.log('fetch');
// TODO: Check if we have it already and if it's stale.
const response = await fetch(
`/sticker/${uuid}`,
);
const json = await response.json();
console.log(json);
// this.stickers.push(json);
this.sticker = json;
console.log('done in fetch');
},
},
state: () => {
return {
// stickers: [],
sticker: null,
};
},
})