Guardar y cambiar img al editar productos
This commit is contained in:
@@ -64,7 +64,7 @@ export const getAllProducts = async (params: {
|
||||
sortOrder?: 'asc' | 'desc';
|
||||
}) => {
|
||||
|
||||
const session = await auth()
|
||||
// const session = await auth()
|
||||
|
||||
const searchParams = new URLSearchParams({
|
||||
page: (params.page || 1).toString(),
|
||||
@@ -74,7 +74,7 @@ export const getAllProducts = async (params: {
|
||||
...(params.sortOrder && { sortOrder: params.sortOrder }),
|
||||
})
|
||||
|
||||
const id = session?.user.id
|
||||
// const id = session?.user.id
|
||||
|
||||
const [error, response] = await safeFetchApi(
|
||||
productApiResponseSchema,
|
||||
@@ -152,8 +152,8 @@ export const updateUserAction2 = async (payload: InventoryTable) => {
|
||||
|
||||
const [error, data] = await safeFetchApi(
|
||||
test,
|
||||
`/pictures/upload`,
|
||||
'POST',
|
||||
`/products/upload`,
|
||||
'PATCH',
|
||||
payload,
|
||||
);
|
||||
|
||||
@@ -161,7 +161,7 @@ export const updateUserAction2 = async (payload: InventoryTable) => {
|
||||
console.error(error);
|
||||
throw new Error(error?.message || 'Error al actualizar el producto');
|
||||
}
|
||||
// console.log(data);
|
||||
console.log(data);
|
||||
return data;
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user