dashpresshq/dashpress

View on GitHub
src/pages/api/integrations/storage/credentials.ts

Summary

Maintainability
A
1 hr
Test Coverage
A
100%
import { requestHandler } from "@/backend/lib/request";
import { storageApiService } from "@/backend/storage/storage.service";
import { UserPermissions } from "@/shared/constants/user";

export default requestHandler(
  {
    POST: async () => {
      return await storageApiService.showStorageCredentials();
    },
  },
  [
    {
      _type: "canUser",
      body: UserPermissions.CAN_MANAGE_APP_CREDENTIALS,
    },
    {
      _type: "withPassword",
    },
  ]
);