working on settings

This commit is contained in:
2024-09-11 21:33:35 -06:00
parent f42f631fad
commit 32b59b3975
7 changed files with 131 additions and 34 deletions

View File

@@ -50,12 +50,6 @@ export async function GET(
return withErrorHandling(async () => {
try {
const url = getUrl(params);
// const response = await axiosClient.get(url, {
// headers: {
// // Include other headers from the incoming request if needed:
// "Content-Type": "application/json",
// },
// });
var requestCount = 1;
url.searchParams.set("per_page", "100");
@@ -100,7 +94,7 @@ export async function POST(
try {
const url = getUrl(params);
const body = await req.json();
const response = await axiosClient.post(url, body);
const response = await axiosClient.post(url.toString(), body);
const headers = proxyResponseHeaders(response);
return new NextResponse(JSON.stringify(response.data), { headers });
@@ -123,7 +117,7 @@ export async function PUT(
try {
const url = getUrl(params);
const body = await req.json();
const response = await axiosClient.put(url, body);
const response = await axiosClient.put(url.toString(), body);
const headers = proxyResponseHeaders(response);
return new NextResponse(JSON.stringify(response.data), { headers });
@@ -143,7 +137,7 @@ export async function DELETE(
return withErrorHandling(async () => {
try {
const url = getUrl(params);
const response = await axiosClient.delete(url);
const response = await axiosClient.delete(url.toString());
const headers = proxyResponseHeaders(response);
return new NextResponse(JSON.stringify(response.data), { headers });

View File

@@ -0,0 +1,9 @@
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
import { withErrorHandling } from "@/services/withErrorHandling";
export const GET = async () =>
await withErrorHandling(async () => {
const directories = await fileStorageService.getEmptyDirectories();
return Response.json(directories);
});