refactor: apply consistent formatting to improve code quality
Some checks failed
Deploy to Production / deploy (push) Failing after 2m20s
Lint / lint (push) Successful in 9m37s

Ensure uniform code formatting across components by aligning with the established code style. Adjust imports, indentation, and spacing to enhance readability and maintainability.
This commit is contained in:
Mathis HERRIOT
2026-01-14 17:26:58 +01:00
parent 03e5915fcc
commit 35abd0496e
95 changed files with 6839 additions and 6659 deletions

View File

@@ -2,54 +2,63 @@ import api from "@/lib/api";
import type { Content, PaginatedResponse } from "@/types/content";
export const ContentService = {
async getExplore(params: {
limit?: number;
offset?: number;
sort?: "trend" | "recent";
tag?: string;
category?: string;
query?: string;
author?: string;
}): Promise<PaginatedResponse<Content>> {
const { data } = await api.get<PaginatedResponse<Content>>("/contents/explore", {
params,
});
return data;
},
async getExplore(params: {
limit?: number;
offset?: number;
sort?: "trend" | "recent";
tag?: string;
category?: string;
query?: string;
author?: string;
}): Promise<PaginatedResponse<Content>> {
const { data } = await api.get<PaginatedResponse<Content>>(
"/contents/explore",
{
params,
},
);
return data;
},
async getTrends(limit = 10, offset = 0): Promise<PaginatedResponse<Content>> {
const { data } = await api.get<PaginatedResponse<Content>>("/contents/trends", {
params: { limit, offset },
});
return data;
},
async getTrends(limit = 10, offset = 0): Promise<PaginatedResponse<Content>> {
const { data } = await api.get<PaginatedResponse<Content>>(
"/contents/trends",
{
params: { limit, offset },
},
);
return data;
},
async getRecent(limit = 10, offset = 0): Promise<PaginatedResponse<Content>> {
const { data } = await api.get<PaginatedResponse<Content>>("/contents/recent", {
params: { limit, offset },
});
return data;
},
async getRecent(limit = 10, offset = 0): Promise<PaginatedResponse<Content>> {
const { data } = await api.get<PaginatedResponse<Content>>(
"/contents/recent",
{
params: { limit, offset },
},
);
return data;
},
async getOne(idOrSlug: string): Promise<Content> {
const { data } = await api.get<Content>(`/contents/${idOrSlug}`);
return data;
},
async getOne(idOrSlug: string): Promise<Content> {
const { data } = await api.get<Content>(`/contents/${idOrSlug}`);
return data;
},
async incrementViews(id: string): Promise<void> {
await api.post(`/contents/${id}/view`);
},
async incrementViews(id: string): Promise<void> {
await api.post(`/contents/${id}/view`);
},
async incrementUsage(id: string): Promise<void> {
await api.post(`/contents/${id}/use`);
},
async incrementUsage(id: string): Promise<void> {
await api.post(`/contents/${id}/use`);
},
async upload(formData: FormData): Promise<Content> {
const { data } = await api.post<Content>("/contents/upload", formData, {
headers: {
"Content-Type": "multipart/form-data",
},
});
return data;
},
async upload(formData: FormData): Promise<Content> {
const { data } = await api.post<Content>("/contents/upload", formData, {
headers: {
"Content-Type": "multipart/form-data",
},
});
return data;
},
};