mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-19 05:54:06 +01:00
Refactor ApplyProject component to update file upload path and add Lottie animation for loading
This commit is contained in:
parent
d32b8c5845
commit
fa40037682
@ -189,16 +189,23 @@ export default function ApplyProject() {
|
|||||||
const folderPath = photos[0].data.path;
|
const folderPath = photos[0].data.path;
|
||||||
const lastSlashIndex = folderPath.lastIndexOf("/");
|
const lastSlashIndex = folderPath.lastIndexOf("/");
|
||||||
const photosPath = folderPath.substring(0, lastSlashIndex);
|
const photosPath = folderPath.substring(0, lastSlashIndex);
|
||||||
const logoURL = getPublicURL(
|
|
||||||
|
// Log for debugging
|
||||||
|
console.log("Bucket Name:", BUCKET_PITCH_APPLICATION_NAME);
|
||||||
|
console.log("Logo Path:", logo.data.path);
|
||||||
|
console.log("Photos Path:", photosPath);
|
||||||
|
|
||||||
|
const logoURL = await getPublicURL(
|
||||||
logo.data.path,
|
logo.data.path,
|
||||||
BUCKET_PITCH_APPLICATION_NAME
|
BUCKET_PITCH_APPLICATION_NAME
|
||||||
)?.publicUrl;
|
);
|
||||||
const photosURL = getPublicURL(
|
const photosURL = await getPublicURL(
|
||||||
photosPath,
|
photosPath,
|
||||||
BUCKET_PITCH_APPLICATION_NAME
|
BUCKET_PITCH_APPLICATION_NAME
|
||||||
)?.publicUrl;
|
);
|
||||||
|
// console.log(logoURL.publicUrl, projectId, logo.data.path);
|
||||||
updateImageURL(logoURL, "project_logo", projectId);
|
console.log(photosURL, projectId, logo.data.path);
|
||||||
|
updateImageURL(logoURL.publicUrl, "project_logo", projectId);
|
||||||
// console.log(logoURL, photosUrl);
|
// console.log(logoURL, photosUrl);
|
||||||
displayAlert(error);
|
displayAlert(error);
|
||||||
};
|
};
|
||||||
@ -214,8 +221,8 @@ export default function ApplyProject() {
|
|||||||
.select();
|
.select();
|
||||||
console.table(data);
|
console.table(data);
|
||||||
};
|
};
|
||||||
const getPublicURL = (path: string, bucketName: string) => {
|
const getPublicURL = async (path: string, bucketName: string) => {
|
||||||
const { data } = supabase.storage.from(bucketName).getPublicUrl(path);
|
const { data } = await supabase.storage.from(bucketName).getPublicUrl(path);
|
||||||
// console.table(data);
|
// console.table(data);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user