mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-31 13:27:58 +00:00
15 lines
486 B
TypeScript
15 lines
486 B
TypeScript
import { ApiResponseStatus } from 'wherehows-web/utils/api/shared';
|
|
|
|
/**
|
|
* Returns a default msg for a given status
|
|
* @param {ApiResponseStatus} status
|
|
* @returns {string}
|
|
*/
|
|
const apiErrorStatusMessage = (status: ApiResponseStatus): string =>
|
|
(<{ [prop: number]: string }>{
|
|
[ApiResponseStatus.NotFound]: 'Could not find the requested resource',
|
|
[ApiResponseStatus.InternalServerError]: 'An error occurred with the server'
|
|
})[status];
|
|
|
|
export { apiErrorStatusMessage };
|