clean project sections and page and set pagination to projects
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user