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