feat: Add About Us page CMS functionality with dedicated sections and image upload support.

This commit is contained in:
pradeepkumar
2026-02-24 03:30:35 +05:30
parent f435173566
commit 956ccede2d
4 changed files with 385 additions and 27 deletions

View File

@@ -1,8 +1,36 @@
import api from './api';
interface PresignedUrlResponse {
uploadUrl: string;
publicUrl: string;
key: string;
}
class UploadService {
private basePath = '/upload';
/**
* Get a presigned upload URL for S3
*/
async getPresignedUploadUrl(filename: string, contentType: string, folder: string): Promise<PresignedUrlResponse> {
const response = await api.post<{ data: PresignedUrlResponse }>(
`${this.basePath}/presigned-url`,
{ filename, contentType, folder }
);
return response.data.data;
}
/**
* Upload a file to S3 using a presigned URL
*/
async uploadFileToS3(uploadUrl: string, file: File): Promise<void> {
await fetch(uploadUrl, {
method: 'PUT',
body: file,
headers: { 'Content-Type': file.type },
});
}
/**
* Get a presigned download URL for an S3 key
*/