{
- e.stopPropagation(); // This prevents the click from propagating to the parent link
- handleClose(); // Then, your handleClose function is called
- }}>
-
-
{
+ e.stopPropagation(); // This prevents the click from propagating to the parent link
+ handleClose(); // Then, your handleClose function is called
+ }}
+ >
+
+
+
+
{category}
-
+
{name1}
-
+
{description}
-
-
+
-
-
+
);
}
-export default DisplayPreviewCard;
+export default DisplayPreviewCard;
\ No newline at end of file
diff --git a/src/supabase/exhibits/queries.tsx b/src/supabase/exhibits/queries.tsx
index 90e6b8b5..93bdea29 100644
--- a/src/supabase/exhibits/queries.tsx
+++ b/src/supabase/exhibits/queries.tsx
@@ -1,6 +1,5 @@
'use client';
-<<<<<<< HEAD
import supabase from '../client';
import { ExhibitRow } from '../../types/types';
@@ -12,25 +11,10 @@ export async function fetchAllExhibits(): Promise {
const { data, error } = await supabase.from('exhibits').select('*');
if (error) {
throw new Error(error.message);
-=======
-import { ExhibitRow } from '../../types/types';
-
-/**
- * Fetches all tours from the database.
- * @returns A promise that resolves to an array of ExhibitRow objects.
- */
-export async function fetchAllExhibits(): Promise {
- const { data, error } = await supabase.from('exhibits').select('*');
- if (error) {
- throw new Error(`An error occurred trying to read exhibits: ${error}`);
->>>>>>> b191485 (added database and page)
}
return data;
}
-<<<<<<< HEAD
-
-
/**
* Fetches a single exhibit from the database.
* @param exhibitId - The id of the exhibit to fetch.
@@ -52,21 +36,25 @@ export async function fetchExhibit(exhibitId: string): Promise {
* @param exhibitId - The id of the exhibit to fetch.
* @returns A promise that resolves to a ExhibitRow object.
*/
-export async function fetchExhibitImage(exhibitId: string): Promise<{ image: string }> {
- const { data, error } = await supabase
- .from('exhibits')
- .select('image')
- .eq('id', exhibitId)
- .single();
+export async function fetchExhibitImage(
+ exhibitId: string,
+): Promise<{ image: string }> {
+ const { data, error } = await supabase
+ .from('exhibits')
+ .select('image')
+ .eq('id', exhibitId)
+ .single();
- if (error) {
- throw new Error(error.message);
- }
+ if (error) {
+ throw new Error(error.message);
+ }
- // Provide a default image URL if the image is null
- const imageUrl = data?.image ?? "https://buffer.com/cdn-cgi/image/w=1000,fit=contain,q=90,f=auto/library/content/images/size/w1200/2023/10/free-images.jpg"; // Adjust the default image path as needed
+ // Provide a default image URL if the image is null
+ const imageUrl =
+ data?.image ??
+ 'https://buffer.com/cdn-cgi/image/w=1000,fit=contain,q=90,f=auto/library/content/images/size/w1200/2023/10/free-images.jpg'; // Adjust the default image path as needed
- return { image: imageUrl };
+ return { image: imageUrl };
}
/**
@@ -74,7 +62,9 @@ export async function fetchExhibitImage(exhibitId: string): Promise<{ image: str
* @param exhibitData - The exhibit to insert.
* @returns A promise that resolves to a ExhibitRow object.
*/
-export async function insertExhibit(exhibitData: ExhibitRow): Promise {
+export async function insertExhibit(
+ exhibitData: ExhibitRow,
+): Promise {
const { data, error } = await supabase.from('exhibits').insert(exhibitData);
if (error) {
throw new Error(error.message);
@@ -88,7 +78,7 @@ export async function insertExhibit(exhibitData: ExhibitRow): Promise {
const { data, error } = await supabase
.from('exhibits')
@@ -105,54 +95,9 @@ export async function updateExhibit(
* @param exhibitData - The exhibit to upsert.
* @returns A promise that resolves to a ExhibitRow object.
*/
-export async function upsertTour(exhibitData: ExhibitRow): Promise {
- const { data, error } = await supabase.from('exhibits').upsert(exhibitData);
- if (error) {
- throw new Error(error.message);
- }
- return data;
-}
-
-/**
- * Deletes a single exhibit from the database.
- * @param exhibitId - The id of the exhibit to delete.
- * @returns A promise that resolves to a ExhibitRow object.
- */
-export async function deleteExhibit(exhibitId: string): Promise {
- const { data, error } = await supabase
- .from('exhibits')
- .delete()
- .eq('id', exhibitId);
- if (error) {
- throw new Error(error.message);
- }
- return data;
-}
-=======
-/**
- * Updates a single exhibit in the database.
- * @param newExhibitData - The updated exhibit data.
- * @returns A promise that resolves to a ExhibitRow object.
- */
-export async function updateExhibit(
- newExhibitData: ExhibitRow,
+export async function upsertTour(
+ exhibitData: ExhibitRow,
): Promise {
- const { data, error } = await supabase
- .from('exhibits')
- .update(newExhibitData)
- .eq('id', newExhibitData.id);
- if (error) {
- throw new Error(error.message);
- }
- return data;
-}
-
-/**
- * Upserts a single exhibit into the database.
- * @param exhibitData - The exhibit to upsert.
- * @returns A promise that resolves to a ExhibitRow object.
- */
-export async function upsertTour(exhibitData: ExhibitRow): Promise {
const { data, error } = await supabase.from('exhibits').upsert(exhibitData);
if (error) {
throw new Error(error.message);
@@ -165,7 +110,9 @@ export async function upsertTour(exhibitData: ExhibitRow): Promise {
+export async function deleteExhibit(
+ exhibitId: string,
+): Promise {
const { data, error } = await supabase
.from('exhibits')
.delete()
@@ -174,6 +121,4 @@ export async function deleteExhibit(exhibitId: string): Promise>>>>>> b191485 (added database and page)
+}
\ No newline at end of file