Skip to content

Commit 80ce036

Browse files
committed
fix(api): change file delete endpoint to use body instead of query
1 parent 60b7026 commit 80ce036

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/calm-trains-jog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/api": patch
3+
---
4+
5+
Fix deleting application files.

src/modules/files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { join } from "path";
21
import { readFile } from "fs/promises";
2+
import { join } from "path";
33

44
import { assertPathLike, assertString } from "@/assertions/literal";
55
import { Routes } from "@/lib/routes";
@@ -113,7 +113,7 @@ export class FilesModule {
113113

114114
const { status } = await this.application.client.api.request(
115115
Routes.apps.files.delete(this.application.id),
116-
{ method: "DELETE", query: { path } },
116+
{ method: "DELETE", body: { path } },
117117
);
118118

119119
return status === "success";

src/types/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export interface APIEndpoints {
9999
};
100100
"apps/files/delete": {
101101
method: "DELETE";
102-
query: RESTDeleteAPIFileDeleteQuery;
102+
body: RESTDeleteAPIFileDeleteQuery;
103103
response: undefined;
104104
};
105105
"apps/deployments/list": {

0 commit comments

Comments
 (0)