(instanceId: string, dotPath: string, type: string, state: EditStatePayload, ctx: BackendContext)
| 98 | } |
| 99 | |
| 100 | export async function editComponentState(instanceId: string, dotPath: string, type: string, state: EditStatePayload, ctx: BackendContext) { |
| 101 | if (!instanceId) { |
| 102 | return |
| 103 | } |
| 104 | const instance = getComponentInstance(ctx.currentAppRecord, instanceId, ctx) |
| 105 | if (instance) { |
| 106 | if ('value' in state && state.value != null) { |
| 107 | state.value = parse(state.value, true) |
| 108 | } |
| 109 | await ctx.currentAppRecord.backend.api.editComponentState(instance, dotPath, type, state, ctx.currentAppRecord.options.app) |
| 110 | await sendSelectedComponentData(ctx.currentAppRecord, instanceId, ctx) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | export async function getComponentId(app: App, uid: number, instance: ComponentInstance, ctx: BackendContext) { |
| 115 | try { |
no test coverage detected