Hotfix dataloader for designers (#141)
This commit is contained in:
@@ -10,9 +10,14 @@ export class DesignerAPI extends BaseSQLDataSource {
|
|||||||
|
|
||||||
constructor(options: DataSourceOptions, config) {
|
constructor(options: DataSourceOptions, config) {
|
||||||
super(options, config);
|
super(options, config);
|
||||||
this.loader = new DataLoader((keys: number[]) =>
|
this.loader = new DataLoader(async (keys: number[]) => {
|
||||||
this.getDesigners(undefined, keys),
|
const designersResult = await this.getDesigners(undefined, keys);
|
||||||
);
|
return keys.map(
|
||||||
|
(key) =>
|
||||||
|
designersResult.find((designerResult) => designerResult.id === key) ??
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDesignerById(id: number): Promise<Designer> {
|
async getDesignerById(id: number): Promise<Designer> {
|
||||||
|
|||||||
Reference in New Issue
Block a user