Explorar el Código

Fix resource not found message

Put message key in its correct location.
master
TheoryOfNekomata hace 7 meses
padre
commit
c55a07fbc2
Se han modificado 4 ficheros con 19 adiciones y 3 borrados
  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 Ver fichero

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


+ 9
- 1
packages/core/src/common/language.ts Ver fichero

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

export const LANGUAGE_DEFAULT_STATUS_MESSAGE_KEYS = [
@@ -37,7 +38,6 @@ export const LANGUAGE_DEFAULT_STATUS_MESSAGE_KEYS = [
'ok',
'resourceCollectionFetched',
'resourceFetched',
'resourceNotFound',
'resourceDeleted',
'resourcePatched',
'resourceCreated',
@@ -328,5 +328,13 @@ export const FALLBACK_LANGUAGE = {
'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;

+ 8
- 0
packages/core/test/utils.ts Ver fichero

@@ -461,5 +461,13 @@ export const TEST_LANGUAGE: Language = {
'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 Ver fichero

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

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
auth: none
}

Cargando…
Cancelar
Guardar