@masterteam/task-schedule 0.0.22 → 0.0.23

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.
@@ -2641,15 +2641,24 @@ class TaskScheduleDialog {
2641
2641
  this.ref.close(response);
2642
2642
  }
2643
2643
  mapSubmitRequest(request) {
2644
- if (this.mode() !== 'create' || !this.parentGuid()) {
2645
- return request;
2644
+ // Schedule items submit under their type-specific schedule module key
2645
+ // ('Task' | 'Milestone' | 'Deliverable'), not the generic 'ModuleData' the
2646
+ // form loads with. The backend only maps the task_* fields (and the parent
2647
+ // link) when the schedule module key is used.
2648
+ const moduleKey = this.selectedType() ?? request.moduleKey;
2649
+ const isSubtaskCreate = this.mode() === 'create' && !!this.parentGuid();
2650
+ if (!isSubtaskCreate) {
2651
+ return { ...request, moduleKey };
2646
2652
  }
2647
2653
  return {
2648
2654
  ...request,
2655
+ moduleKey,
2649
2656
  fields: [
2650
2657
  ...(request.fields ?? []),
2651
2658
  {
2652
- propertyKey: 'parentId',
2659
+ // Parent reference is the anchor row's schedule guid / externalId,
2660
+ // not its numeric database id.
2661
+ propertyKey: 'externalParentId',
2653
2662
  value: this.parentGuid(),
2654
2663
  },
2655
2664
  ],