akanjs 2.2.7-rc.0 → 2.2.7-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -390,7 +390,6 @@ export class FetchClient {
|
|
|
390
390
|
return endpoint;
|
|
391
391
|
}
|
|
392
392
|
#registerModelBaseEndpoint(refName: string, signal: SerializedSignal) {
|
|
393
|
-
const cnst = ConstantRegistry.getDatabase(refName);
|
|
394
393
|
const capRefName = capitalize(refName);
|
|
395
394
|
const names = {
|
|
396
395
|
createModel: `create${capRefName}`,
|
|
@@ -416,6 +415,7 @@ export class FetchClient {
|
|
|
416
415
|
names.viewModel,
|
|
417
416
|
() =>
|
|
418
417
|
(async (id: string, option?: FetchPolicy) => {
|
|
418
|
+
const cnst = ConstantRegistry.getDatabase(refName);
|
|
419
419
|
const modelFn = this.#requireHandler(names.model, names.viewModel);
|
|
420
420
|
const modelObj = await modelFn(id, { ...option, crystalize: false });
|
|
421
421
|
const model = new cnst.full(modelObj as object);
|
|
@@ -438,6 +438,7 @@ export class FetchClient {
|
|
|
438
438
|
names.editModel,
|
|
439
439
|
() =>
|
|
440
440
|
(async (id: string, option?: FetchPolicy) => {
|
|
441
|
+
const cnst = ConstantRegistry.getDatabase(refName);
|
|
441
442
|
const modelFn = this.#requireHandler(names.model, names.editModel);
|
|
442
443
|
const modelObj = await modelFn(id, { ...option, crystalize: false });
|
|
443
444
|
const model = new cnst.full(modelObj as object);
|
|
@@ -516,7 +517,6 @@ export class FetchClient {
|
|
|
516
517
|
return endpoint;
|
|
517
518
|
}
|
|
518
519
|
#registerSlice(refName: string, suffix: string, slice: SerializedSlice, prefix?: string) {
|
|
519
|
-
const cnst = ConstantRegistry.getDatabase(refName);
|
|
520
520
|
const capSuffix = capitalize(suffix);
|
|
521
521
|
const sliceName = `${refName}${capSuffix}`;
|
|
522
522
|
const capRefName = capitalize(refName);
|
|
@@ -535,6 +535,7 @@ export class FetchClient {
|
|
|
535
535
|
const argLength = slice.args.length;
|
|
536
536
|
this.slice[sliceName] = { refName, sliceName, argLength };
|
|
537
537
|
this.#handlerFactory.set(names.init, () => async (...argData: unknown[]) => {
|
|
538
|
+
const cnst = ConstantRegistry.getDatabase(refName);
|
|
538
539
|
const queryArgs = normalizeQueryArgs(
|
|
539
540
|
Array.from({ length: Math.min(argData.length, argLength) }, (_, idx) => argData[idx]),
|
|
540
541
|
slice.args,
|