Skip to content

Commit 4235a91

Browse files
committed
fix: update setStatus method to accept optional message parameter in IAdminForthHttpResponse
1 parent 28a1391 commit 4235a91

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

adminforth/modules/restApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
718718

719719

720720
if (!userRecord) {
721-
response.setStatus(401, 'Unauthorized');
721+
response.setStatus(401);
722722
return { error: INVALID_MESSAGE };
723723
}
724724

@@ -749,7 +749,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
749749
});
750750
}
751751
} else {
752-
response.setStatus(401, 'Unauthorized');
752+
response.setStatus(401);
753753
return { error: INVALID_MESSAGE };
754754
}
755755

adminforth/types/Back.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface IConfigValidator {
3636

3737
export interface IAdminForthHttpResponse {
3838
setHeader: (key: string, value: string) => void,
39-
setStatus: (code: number, message: string) => void,
39+
setStatus: (code: number, message?: string) => void,
4040
blobStream: () => Writable,
4141
};
4242

0 commit comments

Comments
 (0)