Browse Source

Fix resource not found message

Put message key in its correct location.
master
TheoryOfNekomata 7 months ago
parent
commit
c55a07fbc2
4 changed files with 19 additions and 3 deletions
  1. +1
    -1
      packages/core/src/backend/servers/http/core.ts
  2. +9
    -1
      packages/core/src/common/language.ts
  3. +8
    -0
      packages/core/test/utils.ts
  4. +1
    -1
      packages/examples/cms-web-api/bruno/Get Single Post.bru

+ 1
- 1
packages/core/src/backend/servers/http/core.ts View File

@@ -4,7 +4,7 @@ import {constants} from 'http2';
import * as v from 'valibot'; import * as v from 'valibot';
import { import {
AllowedMiddlewareSpecification, AllowedMiddlewareSpecification,
BackendState, getAllowString,
BackendState,
Middleware, Middleware,
RequestContext, RequestContext,
RequestDecorator, RequestDecorator,


+ 9
- 1
packages/core/src/common/language.ts View File

@@ -30,6 +30,7 @@ export const LANGUAGE_DEFAULT_ERROR_STATUS_MESSAGE_KEYS = [
'invalidResource', 'invalidResource',
'notImplemented', 'notImplemented',
'internalServerError', 'internalServerError',
'resourceNotFound',
] as const; ] as const;


export const LANGUAGE_DEFAULT_STATUS_MESSAGE_KEYS = [ export const LANGUAGE_DEFAULT_STATUS_MESSAGE_KEYS = [
@@ -37,7 +38,6 @@ export const LANGUAGE_DEFAULT_STATUS_MESSAGE_KEYS = [
'ok', 'ok',
'resourceCollectionFetched', 'resourceCollectionFetched',
'resourceFetched', 'resourceFetched',
'resourceNotFound',
'resourceDeleted', 'resourceDeleted',
'resourcePatched', 'resourcePatched',
'resourceCreated', 'resourceCreated',
@@ -328,5 +328,13 @@ export const FALLBACK_LANGUAGE = {
'Contact the administrator regarding missing configuration or unavailability of dependencies.', 'Contact the administrator regarding missing configuration or unavailability of dependencies.',
], ],
], ],
resourceNotFound: [
'The resource in the provided URL could not be found.',
[
'Check if the request URL is correct.',
'Try the request again at a later time.',
'Contact the administrator regarding missing configuration or unavailability of dependencies.',
],
],
}, },
} satisfies Language; } satisfies Language;

+ 8
- 0
packages/core/test/utils.ts View File

@@ -461,5 +461,13 @@ export const TEST_LANGUAGE: Language = {
'Contact the administrator regarding missing configuration or unavailability of dependencies.', 'Contact the administrator regarding missing configuration or unavailability of dependencies.',
], ],
], ],
resourceNotFound: [
'The resource in the provided URL could not be found.',
[
'Check if the request URL is correct.',
'Try the request again at a later time.',
'Contact the administrator regarding missing configuration or unavailability of dependencies.',
],
],
}, },
}; };

+ 1
- 1
packages/examples/cms-web-api/bruno/Get Single Post.bru View File

@@ -5,7 +5,7 @@ meta {
} }


get { get {
url: http://localhost:6969/api/posts/5fac64d6-d261-42bb-a67b-bc7e1955a7e2
url: http://localhost:6969/api/posts/9ba60691-0cd3-4e8a-9f44-e92b19fcacbc
body: none body: none
auth: none auth: none
} }

Loading…
Cancel
Save