clean project sections and page and set pagination to projects

This commit is contained in:
2025-06-18 20:02:27 +03:30
parent 8ddf2dc7db
commit 38df8ec335
14 changed files with 179 additions and 81 deletions
+6 -2
View File
@@ -3,15 +3,19 @@
import api from '@/lib/axios';
import { cookies } from 'next/headers';
export async function getProjects() {
export async function getProjects(page = 1 as number) {
const cookiesStore = await cookies();
console.log('page');
console.log(page);
return api
.get('/projects', {
params: { page },
headers: {
Cookie: cookiesStore.toString(),
},
})
.then(({ data }) => Promise.resolve(data.data))
.then(({ data }) => Promise.resolve(data))
.catch((error) => Promise.reject(error));
}