bug: missing images when not authenticated

This commit is contained in:
2025-04-24 21:33:28 -04:00
parent d0876861dc
commit c7353626a1
4 changed files with 8 additions and 12 deletions

View File

@@ -201,9 +201,9 @@ function toggleEditMode() {
// Fetch album data
async function fetchAlbumData() {
if (!creatorProfileStore.creator?.id) return;
if (!brandingStore.value?.id) return;
albumId.value = creatorProfileStore.creator.id;
albumId.value = brandingStore.value.id;
try {
// Try to get the album
@@ -247,7 +247,7 @@ function updateImages(newImages) {
}
async function saveChanges() {
if (!creatorProfileStore.creator.id) {
if (!brandingStore.value?.id) {
console.error("L'ID du créateur est manquant !");
return;
}
@@ -262,7 +262,7 @@ async function saveChanges() {
// Save presentation info
const presentationResponse = await client.post(
`/api/creators/${creatorProfileStore.creator.id}/presentation-infos`,
`/api/creators/${brandingStore.value.id}/presentation-infos`,
{
description: editableDescription.value || "",
videoUrl: editableVideoUrl.value || "",
@@ -280,13 +280,13 @@ async function saveChanges() {
// Save album photos if they've changed
if (imageUrls.value.length > 0) {
// Create or update the album
const albumId = creatorProfileStore.creator.id;
const albumId = brandingStore.value.id;
try {
// Try to create the album first (it will fail if it already exists)
await client.post('/api/albums', {
albumId: albumId,
title: `${creatorProfileStore.creator.name}'s Album`,
title: `${brandingStore.value.name}'s Album`,
description: "Photo album for the creator"
});
} catch (error) {