mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Fixed: delete component unkown error
This commit is contained in:
parent
a5458eeeaa
commit
8489b5355d
1 changed files with 7 additions and 5 deletions
|
|
@ -68,12 +68,12 @@ export class ComponentsService {
|
|||
}
|
||||
|
||||
async update(componentDiff: object, appVersionId: string) {
|
||||
return dbTransactionForAppVersionAssociationsUpdate(async (manager:EntityManager) => {
|
||||
return dbTransactionForAppVersionAssociationsUpdate(async (manager: EntityManager) => {
|
||||
for (const componentId in componentDiff) {
|
||||
const { component } = componentDiff[componentId];
|
||||
|
||||
const componentData: Component = await manager.findOne(Component, {
|
||||
where: { id: componentId }
|
||||
where: { id: componentId },
|
||||
});
|
||||
|
||||
if (!componentData) {
|
||||
|
|
@ -123,7 +123,9 @@ export class ComponentsService {
|
|||
|
||||
async delete(componentIds: string[], appVersionId: string, isComponentCut = false) {
|
||||
return dbTransactionForAppVersionAssociationsUpdate(async (manager: EntityManager) => {
|
||||
const components = await manager.find(Component, { where: In(componentIds)});
|
||||
const components = await manager.find(Component, {
|
||||
where: { id: In(componentIds) },
|
||||
});
|
||||
|
||||
if (!components.length) {
|
||||
return {
|
||||
|
|
@ -139,7 +141,7 @@ export class ComponentsService {
|
|||
});
|
||||
}
|
||||
|
||||
await manager.delete(Component, componentIds);
|
||||
await manager.delete(Component, { id: In(componentIds) });
|
||||
}, appVersionId);
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +164,7 @@ export class ComponentsService {
|
|||
const { layouts, component } = componenstLayoutDiff[componentId];
|
||||
|
||||
for (const type in layouts) {
|
||||
const componentLayout = await manager.findOne(Layout, { where: {componentId, type} });
|
||||
const componentLayout = await manager.findOne(Layout, { where: { componentId, type } });
|
||||
|
||||
if (componentLayout) {
|
||||
const layout = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue