2023-03-08 23:13:33 +01:00
|
|
|
export const useStraniStore = defineStore('strani', {
|
|
|
|
state: () => ({
|
|
|
|
strani: {}
|
|
|
|
}),
|
|
|
|
actions: {
|
|
|
|
async naloziStrani () {
|
|
|
|
const { baseUrl, headers, deserialize } = useApi()
|
|
|
|
|
|
|
|
const data = await $fetch(`${baseUrl}/node/page`, { headers })
|
|
|
|
this.strani = await deserialize(data, s => ({
|
|
|
|
id: s.id,
|
|
|
|
naslov: s.title,
|
|
|
|
tekst: s.body.processed
|
2023-05-03 21:31:01 +02:00
|
|
|
}), 'naslov')
|
2023-03-08 23:13:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|