dashpresshq/dashpress

View on GitHub
src/pages/api/entities/[entity]/fields.ts

Summary

Maintainability
A
30 mins
Test Coverage
A
100%
import { entitiesApiService } from "@/backend/entities/entities.service";
import { requestHandler } from "@/backend/lib/request";

export default requestHandler({
  GET: async (getValidatedRequest) => {
    const validatedRequest = await getValidatedRequest(["entity"]);

    return await entitiesApiService.getEntityFields(validatedRequest.entity);
  },
});