Parcourir la source

Fix resource not found message

Put message key in its correct location.
master
TheoryOfNekomata il y a 7 mois
Parent
révision
c55a07fbc2
4 fichiers modifiés avec 19 ajouts et 3 suppressions
  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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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
}

Chargement…
Annuler
Enregistrer