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>
|
<script setup>
|
||||||
// ITEM FETCHING //
|
// ITEM FETCHING //
|
||||||
// set initial sort order
|
// set initial sort order
|
||||||
const sortVariable = ref(["reserved", "date_created"]);
|
const sortVariable = ref(['reserved', 'date_created'])
|
||||||
const reservedVariable = ref(true);
|
const reservedVariable = ref(true)
|
||||||
// fetch data
|
// fetch data
|
||||||
const { homepage } = await GqlGetHomepage();
|
const { homepage } = await GqlGetHomepage()
|
||||||
const { data, refresh } = await useAsyncData("gifts", () =>
|
const { data, refresh } = await useAsyncData('gifts', () =>
|
||||||
GqlGifts({ sort: sortVariable.value })
|
GqlGifts({ sort: sortVariable.value })
|
||||||
);
|
)
|
||||||
// update sort param
|
// update sort param
|
||||||
function sortList(param) {
|
function sortList(param) {
|
||||||
sortVariable.value = param;
|
sortVariable.value = param
|
||||||
// refetch query (expose token or access pubic data)
|
// refetch query (expose token or access pubic data)
|
||||||
refresh();
|
refresh()
|
||||||
}
|
}
|
||||||
// filter out already reserved items
|
// filter out already reserved items
|
||||||
const filteredList = computed(() => {
|
const filteredList = computed(() => {
|
||||||
const list = data;
|
const list = data
|
||||||
return list;
|
return list
|
||||||
});
|
})
|
||||||
|
|
||||||
// CHANGE DISPLAY //
|
// CHANGE DISPLAY //
|
||||||
const listDisplay = ref(false);
|
const listDisplay = ref(false)
|
||||||
function toggleDisplay() {
|
function toggleDisplay() {
|
||||||
listDisplay.value = !listDisplay.value;
|
listDisplay.value = !listDisplay.value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ITEM RESERVATION //
|
// ITEM RESERVATION //
|
||||||
// no error to start
|
// no error to start
|
||||||
const errorStatus = ref(false);
|
const errorStatus = ref(false)
|
||||||
const statusMessage = ref("");
|
const statusMessage = ref('')
|
||||||
// update the chosen item's reservation status
|
// update the chosen item's reservation status
|
||||||
async function runMutation(payload) {
|
async function runMutation(payload) {
|
||||||
try {
|
try {
|
||||||
|
@ -37,23 +37,23 @@ async function runMutation(payload) {
|
||||||
id: payload.id,
|
id: payload.id,
|
||||||
reserved: payload.reserve,
|
reserved: payload.reserve,
|
||||||
name: payload.name,
|
name: payload.name,
|
||||||
});
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// if error, set the status to true
|
// if error, set the status to true
|
||||||
console.log("---ERREUR---", error);
|
console.log('---ERREUR---', error)
|
||||||
errorStatus.value = true;
|
errorStatus.value = true
|
||||||
} finally {
|
} finally {
|
||||||
if (errorStatus.value) {
|
if (errorStatus.value) {
|
||||||
// if error is true, show an error notice
|
// if error is true, show an error notice
|
||||||
statusMessage.value = "Une erreur est survenue… ¯\\_(ツ)_/¯";
|
statusMessage.value = 'Une erreur est survenue… ¯\\_(ツ)_/¯'
|
||||||
// cleanup the error status
|
// cleanup the error status
|
||||||
errorStatus.value = false;
|
errorStatus.value = false
|
||||||
} else {
|
} else {
|
||||||
// if all is well, show a success notice
|
// 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(() => {
|
setTimeout(() => {
|
||||||
refresh();
|
refresh()
|
||||||
}, 3500);
|
}, 3500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,9 +64,9 @@ async function runMutation(payload) {
|
||||||
<h1>Liste de naissance</h1>
|
<h1>Liste de naissance</h1>
|
||||||
<section class="intro sidebar--reverse" data-direction="rtl">
|
<section class="intro sidebar--reverse" data-direction="rtl">
|
||||||
<article v-html="homepage.content" class="editorial" />
|
<article v-html="homepage.content" class="editorial" />
|
||||||
<div>
|
<div v-if="homepage.illustration">
|
||||||
<NuxtPicture
|
<NuxtPicture
|
||||||
:src="`https://admin.habillerbebe.liliste.fr/assets/${homepage.illustration.id}.`"
|
:src="`https://admin.liliste.fr/assets/${homepage.illustration.id}.`"
|
||||||
width="900"
|
width="900"
|
||||||
height="563"
|
height="563"
|
||||||
class="intro__image"
|
class="intro__image"
|
||||||
|
|
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -1,30 +1,30 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: { type: Object, default: () => {} },
|
item: { type: Object, default: () => {} },
|
||||||
statusMessage: { type: String, default: "" },
|
statusMessage: { type: String, default: '' },
|
||||||
});
|
})
|
||||||
|
|
||||||
let showDetails = ref(true);
|
let showDetails = ref(true)
|
||||||
|
|
||||||
const formError = ref("");
|
const formError = ref('')
|
||||||
const isFormVisible = ref(false);
|
const isFormVisible = ref(false)
|
||||||
function showReservation() {
|
function showReservation() {
|
||||||
isFormVisible.value = !isFormVisible.value;
|
isFormVisible.value = !isFormVisible.value
|
||||||
}
|
}
|
||||||
|
|
||||||
const reserved = ref(false);
|
const reserved = ref(false)
|
||||||
const fromName = ref("");
|
const fromName = ref('')
|
||||||
const emit = defineEmits(["reserved"]);
|
const emit = defineEmits(['reserved'])
|
||||||
|
|
||||||
const sendReservation = (id, reserve, name) => {
|
const sendReservation = (id, reserve, name) => {
|
||||||
console.log(fromName);
|
console.log(fromName)
|
||||||
if (reserved.value && fromName.value.length > 1) {
|
if (reserved.value && fromName.value.length > 1) {
|
||||||
emit("reserved", { id, reserve, name });
|
emit('reserved', { id, reserve, name })
|
||||||
formError.value = "";
|
formError.value = ''
|
||||||
} else {
|
} else {
|
||||||
formError.value = "Veuillez remplir le formulaire";
|
formError.value = 'Veuillez remplir le formulaire'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,7 +37,7 @@ const sendReservation = (id, reserve, name) => {
|
||||||
<p v-if="!item.reserved">🎉 Ce cadeau est disponible !</p>
|
<p v-if="!item.reserved">🎉 Ce cadeau est disponible !</p>
|
||||||
<p v-else>
|
<p v-else>
|
||||||
Ce cadeau est déjà réservé par
|
Ce cadeau est déjà réservé par
|
||||||
<span class="from-name">{{ item.from || "¯\_(ツ)_/¯" }}</span> 🤗
|
<span class="from-name">{{ item.from || '¯\_(ツ)_/¯' }}</span> 🤗
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="!item.reserved && item.prix" class="h2 gift__price">
|
<p v-if="!item.reserved && item.prix" class="h2 gift__price">
|
||||||
|
@ -107,7 +107,7 @@ const sendReservation = (id, reserve, name) => {
|
||||||
v-if="item.photo"
|
v-if="item.photo"
|
||||||
format="avif,webp"
|
format="avif,webp"
|
||||||
class="gift__photo"
|
class="gift__photo"
|
||||||
:src="`https://admin.habillerbebe.liliste.fr/assets/${item.photo.id}?width=200&height=200&fit=inside`"
|
:src="`https://admin.liliste.fr/assets/${item.photo.id}?width=200&height=200&fit=inside`"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
width="200"
|
width="200"
|
||||||
height="200"
|
height="200"
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxt/devtools": "latest",
|
"@nuxt/devtools": "latest",
|
||||||
"@nuxt/image": "npm:@nuxt/image-nightly@latest",
|
"@nuxt/image": "npm:@nuxt/image-nightly@latest",
|
||||||
"nuxt": "^3.10.3",
|
"nuxt": "^3.17.6",
|
||||||
"postcss-import-ext-glob": "^2.1.1",
|
"postcss-import-ext-glob": "^2.1.1",
|
||||||
"vue": "^3.4.21",
|
"vue": "^3.5.17",
|
||||||
"vue-router": "^4.3.0"
|
"vue-router": "^4.5.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nuxt-graphql-client": "^0.2.33"
|
"nuxt-graphql-client": "^0.2.46"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
query gifts($sort: [String!]) {
|
query gifts($sort: [String!]) {
|
||||||
gifts(filter: { status: { _eq: "published" } }, sort: $sort) {
|
gifts(
|
||||||
|
filter: {
|
||||||
|
_and: [
|
||||||
|
{ status: { _eq: "published" } }
|
||||||
|
{ user_created: { _eq: "b6ea47ff-718b-4d3f-a712-0623a7cb51b7" } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
sort: $sort
|
||||||
|
) {
|
||||||
status
|
status
|
||||||
|
user_created
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
url
|
url
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
query getHomepage {
|
query getHomepage {
|
||||||
homepage {
|
homepage: homepage_by_id(id: 1) {
|
||||||
date_updated
|
date_updated
|
||||||
content
|
content
|
||||||
illustration {
|
illustration {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue