protected async deleteImage()

in src/base-commands/api.ts [91:105]


  protected async deleteImage(id: string, hardDelete: boolean) {
    const mainEndpoint = `${this.profile!.mediaApiHost}images/${id}`

    const endpoint = hardDelete ? `${mainEndpoint}/hard-delete` : mainEndpoint

    const url = new URL(endpoint)

    const response = await this.http!.delete(url)

    if (response.status === 202) {
      return
    }

    throw new Error(`Failed to delete image ${id}, response status ${response.status}`)
  }