feat: add dynamic site settings, hero media, admin panels, and database integration

This commit is contained in:
mstfyldz
2026-06-05 16:59:05 +03:00
parent 121e127f6b
commit 94182b6bc5
27 changed files with 1894 additions and 52 deletions
+21
View File
@@ -0,0 +1,21 @@
import { v2 as cloudinary } from 'cloudinary';
export async function uploadImage(file: File): Promise<string> {
const arrayBuffer = await file.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
return new Promise((resolve, reject) => {
const uploadStream = cloudinary.uploader.upload_stream(
{ folder: 'moybeach', resource_type: 'auto' },
(error, result) => {
if (error) {
reject(error);
} else {
resolve(result!.secure_url);
}
}
);
uploadStream.end(buffer);
});
}