mirror of
https://github.com/SigNoz/signoz.git
synced 2026-03-20 03:30:26 +00:00
* feat: updated the generated apis * feat: added forgot password feature * feat: handled single org id * feat: correct the success message * feat: removed comments * feat: added test cases * feat: added loading in submit enabled condition * feat: updated styles * feat: removed light mode overrides as used semantic tokens * feat: addressed comments and feedback * feat: changed logic according to new open api spec * feat: addressed comments and used signozhq * feat: added signozhq icon in modulenamemapper * feat: used styles variables from design-token for typography * feat: refactored code to resolve comments
27 lines
524 B
TypeScript
27 lines
524 B
TypeScript
import { ResponseResolver, restContext, RestRequest } from 'msw';
|
|
|
|
export const createErrorResponse = (
|
|
status: number,
|
|
code: string,
|
|
message: string,
|
|
): ResponseResolver<RestRequest, typeof restContext> => (
|
|
_req,
|
|
res,
|
|
ctx,
|
|
): ReturnType<ResponseResolver<RestRequest, typeof restContext>> =>
|
|
res(
|
|
ctx.status(status),
|
|
ctx.json({
|
|
error: {
|
|
code,
|
|
message,
|
|
},
|
|
}),
|
|
);
|
|
|
|
export const handleInternalServerError = createErrorResponse(
|
|
500,
|
|
'INTERNAL_SERVER_ERROR',
|
|
'Internal server error occurred',
|
|
);
|