Skip to content

Commit

Permalink
feat: 将mergefilechunks正确返回状态码改为 204
Browse files Browse the repository at this point in the history
  • Loading branch information
Miracle575 committed Jul 9, 2024
1 parent 721eac5 commit 929fa8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/portal-web/src/apis/api.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ export const mockApi: MockApi<typeof api> = {
comment: "",
}]}),

mergeFileChunks: null,

};


Expand Down
4 changes: 2 additions & 2 deletions apps/portal-web/src/pages/api/file/mergeFileChunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const MergeFileChunksSchema = typeboxRouteSchema({
}),

responses: {
200: Type.Null(),
204: Type.Null(),
409: Type.Object({ code: Type.Literal("ALREADY_EXISTS") }),
400: Type.Object({ code: Type.Literal("INVALID_CLUSTER") }),
},
Expand Down Expand Up @@ -64,7 +64,7 @@ export default route(MergeFileChunksSchema, async (req, res) => {
cluster, path, userId: info.identityId, md5, name,
}).then(async () => {
await callLog(logInfo, OperationResult.SUCCESS);
return { 200: null };
return { 204: null };
}, handlegRPCError({
[status.NOT_FOUND]: () => ({ 400: { code: "INVALID_CLUSTER" as const } }),
[status.ALREADY_EXISTS]: () => ({ 409: { code: "ALREADY_EXISTS" as const } }),
Expand Down

0 comments on commit 929fa8c

Please sign in to comment.