chore(maintenance): dep update + url update
This commit is contained in:
parent
18aa35b2bd
commit
9823706462
7 changed files with 2331 additions and 46 deletions
48
app.vue
48
app.vue
|
@ -1,35 +1,35 @@
|
|||
<script setup>
|
||||
// ITEM FETCHING //
|
||||
// set initial sort order
|
||||
const sortVariable = ref(["reserved", "date_created"]);
|
||||
const reservedVariable = ref(true);
|
||||
const sortVariable = ref(['reserved', 'date_created'])
|
||||
const reservedVariable = ref(true)
|
||||
// fetch data
|
||||
const { homepage } = await GqlGetHomepage();
|
||||
const { data, refresh } = await useAsyncData("gifts", () =>
|
||||
const { homepage } = await GqlGetHomepage()
|
||||
const { data, refresh } = await useAsyncData('gifts', () =>
|
||||
GqlGifts({ sort: sortVariable.value })
|
||||
);
|
||||
)
|
||||
// update sort param
|
||||
function sortList(param) {
|
||||
sortVariable.value = param;
|
||||
sortVariable.value = param
|
||||
// refetch query (expose token or access pubic data)
|
||||
refresh();
|
||||
refresh()
|
||||
}
|
||||
// filter out already reserved items
|
||||
const filteredList = computed(() => {
|
||||
const list = data;
|
||||
return list;
|
||||
});
|
||||
const list = data
|
||||
return list
|
||||
})
|
||||
|
||||
// CHANGE DISPLAY //
|
||||
const listDisplay = ref(false);
|
||||
const listDisplay = ref(false)
|
||||
function toggleDisplay() {
|
||||
listDisplay.value = !listDisplay.value;
|
||||
listDisplay.value = !listDisplay.value
|
||||
}
|
||||
|
||||
// ITEM RESERVATION //
|
||||
// no error to start
|
||||
const errorStatus = ref(false);
|
||||
const statusMessage = ref("");
|
||||
const errorStatus = ref(false)
|
||||
const statusMessage = ref('')
|
||||
// update the chosen item's reservation status
|
||||
async function runMutation(payload) {
|
||||
try {
|
||||
|
@ -37,23 +37,23 @@ async function runMutation(payload) {
|
|||
id: payload.id,
|
||||
reserved: payload.reserve,
|
||||
name: payload.name,
|
||||
});
|
||||
})
|
||||
} catch (error) {
|
||||
// if error, set the status to true
|
||||
console.log("---ERREUR---", error);
|
||||
errorStatus.value = true;
|
||||
console.log('---ERREUR---', error)
|
||||
errorStatus.value = true
|
||||
} finally {
|
||||
if (errorStatus.value) {
|
||||
// if error is true, show an error notice
|
||||
statusMessage.value = "Une erreur est survenue… ¯\\_(ツ)_/¯";
|
||||
statusMessage.value = 'Une erreur est survenue… ¯\\_(ツ)_/¯'
|
||||
// cleanup the error status
|
||||
errorStatus.value = false;
|
||||
errorStatus.value = false
|
||||
} else {
|
||||
// if all is well, show a success notice
|
||||
statusMessage.value = `C'est noté merci beaucoup ${payload.name} 🥰`;
|
||||
statusMessage.value = `C'est noté merci beaucoup ${payload.name} 🥰`
|
||||
setTimeout(() => {
|
||||
refresh();
|
||||
}, 3500);
|
||||
refresh()
|
||||
}, 3500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,9 +64,9 @@ async function runMutation(payload) {
|
|||
<h1>Liste de naissance</h1>
|
||||
<section class="intro sidebar--reverse" data-direction="rtl">
|
||||
<article v-html="homepage.content" class="editorial" />
|
||||
<div>
|
||||
<div v-if="homepage.illustration">
|
||||
<NuxtPicture
|
||||
:src="`https://admin.habillerbebe.liliste.fr/assets/${homepage.illustration.id}.`"
|
||||
:src="`https://admin.liliste.fr/assets/${homepage.illustration.id}.`"
|
||||
width="900"
|
||||
height="563"
|
||||
class="intro__image"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue