• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 25739744753

12 May 2026 02:05PM UTC coverage: 39.493% (-34.9%) from 74.366%
25739744753

Pull #1102

github

web-flow
Merge 8db6e774f into defbbb616
Pull Request #1102: fix: add more acceptance test coverage

2113 of 5922 branches covered (35.68%)

Branch coverage included in aggregate %.

4230 of 10139 relevant lines covered (41.72%)

35.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

22.22
/src/http/routes/object/deleteObject.ts
1
import { FastifyInstance } from 'fastify'
2
import { FromSchema } from 'json-schema-to-ts'
3
import { createDefaultSchema, createResponse } from '../../routes-helper'
4
import { AuthenticatedRequest } from '../../types'
5
import { ROUTE_OPERATIONS } from '../operations'
6

7
const deleteObjectParamsSchema = {
2✔
8
  type: 'object',
9
  properties: {
10
    bucketName: { type: 'string', examples: ['avatars'] },
11
    '*': { type: 'string', examples: ['folder/cat.png'] },
12
  },
13
  required: ['bucketName', '*'],
14
} as const
15
const successResponseSchema = {
2✔
16
  type: 'object',
17
  properties: {
18
    message: { type: 'string', examples: ['Successfully deleted'] },
19
  },
20
}
21
interface deleteObjectRequestInterface extends AuthenticatedRequest {
22
  Params: FromSchema<typeof deleteObjectParamsSchema>
23
}
24

25
export default async function routes(fastify: FastifyInstance) {
26
  const summary = 'Delete an object'
×
27

28
  const schema = createDefaultSchema(successResponseSchema, {
×
29
    params: deleteObjectParamsSchema,
30
    summary,
31
    tags: ['object'],
32
  })
33

34
  fastify.delete<deleteObjectRequestInterface>(
×
35
    '/:bucketName/*',
36
    {
37
      schema,
38
      config: {
39
        operation: { type: ROUTE_OPERATIONS.DELETE_OBJECT },
40
      },
41
    },
42
    async (request, response) => {
43
      const { bucketName } = request.params
×
44
      const objectName = request.params['*']
×
45

46
      await request.storage.from(bucketName).deleteObject(objectName)
×
47

48
      return response.status(200).send(createResponse('Successfully deleted'))
×
49
    }
50
  )
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc