diff --git a/backend/src/Web/Features/Contents/Handlers/GetAlbum.cs b/backend/src/Web/Features/Contents/Handlers/GetAlbum.cs index 4bb07e9..6aee04f 100644 --- a/backend/src/Web/Features/Contents/Handlers/GetAlbum.cs +++ b/backend/src/Web/Features/Contents/Handlers/GetAlbum.cs @@ -43,6 +43,7 @@ public class GetAlbumHandler( { public override void Configure() { + AllowAnonymous(); Get("/api/albums/{AlbumId}"); Options(o => o.WithTags("Albums")); } @@ -51,13 +52,11 @@ public class GetAlbumHandler( GetAlbumRequest request, CancellationToken ct) { - var userId = User.GetUserId(); - var album = await context .Albums .Include(a => a.Photos.OrderBy(p => p.Order)) .SingleOrDefaultAsync( - a => a.Id == request.AlbumId && a.CreatedBy == userId, + a => a.Id == request.AlbumId, cancellationToken: ct); if (album is null) diff --git a/frontend/src/stores/brandingStore.js b/frontend/src/stores/brandingStore.js index 165ee95..ab8c88c 100644 --- a/frontend/src/stores/brandingStore.js +++ b/frontend/src/stores/brandingStore.js @@ -22,10 +22,8 @@ export const useBrandingStore = defineStore( watch( () => route.params.creator, async (creator) => { - console.log(`creator: ${creator}`) // Extract just the creator name from the path (remove any additional segments) const creatorName = creator ? creator.split('/')[0] : undefined; - console.log(`name: ${creatorName}`) await updateBrand(creatorName); } ) diff --git a/frontend/src/views/creators/AboutCreator.vue b/frontend/src/views/creators/AboutCreator.vue index 7e08936..2ef8885 100644 --- a/frontend/src/views/creators/AboutCreator.vue +++ b/frontend/src/views/creators/AboutCreator.vue @@ -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) { diff --git a/frontend/src/views/creators/CreatorLayout.vue b/frontend/src/views/creators/CreatorLayout.vue index ca434b7..8cf96c3 100644 --- a/frontend/src/views/creators/CreatorLayout.vue +++ b/frontend/src/views/creators/CreatorLayout.vue @@ -11,7 +11,6 @@ const creatorName = window.location.pathname.split('/@')[1]?.split('/')[0] || '' const { t } = useI18n(); onMounted(async () => { - console.log(`creatorName: ${creatorName}`) await brandingStore.updateBrand(creatorName); });