Skip to content

Commit

Permalink
fix(orb-ui): Sink details partial edit
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-mendonca-encora committed Sep 26, 2023
1 parent d6135bd commit 51262e4
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ui/src/app/pages/sinks/view/sink.view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,21 @@ export class SinkViewComponent implements OnInit, OnChanges, OnDestroy {

const details = { ...sinkDetails, tags };

let payload = { id, backend, config: {}};

try {
const config = YAML.parse(configSink);
payload.config = config;

if (this.editMode.details) {
payload = { ...payload, ...details };
let payload: any;
if (this.editMode.config && !this.editMode.details) {
payload = { id, backend, config: {}};
const config = YAML.parse(configSink);
payload.config = config;
}
if (this.editMode.details && !this.editMode.config) {
payload = { id, backend, ...details };
}
if (this.editMode.details && this.editMode.config) {
payload = { id, backend, ...details, config: {}};
const config = YAML.parse(configSink);
payload.config = config;
}

this.sinks.editSink(payload as Sink).subscribe(
(resp) => {
this.discard();
Expand Down

0 comments on commit 51262e4

Please sign in to comment.