Skip to content

Commit

Permalink
fix(ui): fix copying of headers (#1269)
Browse files Browse the repository at this point in the history
close #1268
  • Loading branch information
ChrisIgel authored and tchiotludo committed Apr 4, 2023
1 parent aa7e5b9 commit 4e17d98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/containers/Topic/Topic/TopicData/TopicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class TopicData extends Root {
const data = {
partition: row.partition,
key: row.key,
header: row.headers,
headers: row.headers,
keySchemaId: row.schema.key,
valueSchemaId: row.schema.value,
value: row.value
Expand Down
6 changes: 3 additions & 3 deletions client/src/containers/Topic/TopicProduce/TopicProduce.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class TopicProduce extends Form {
}

async initByTopicEvent(copyValues) {
const { header, keySchemaId, valueSchemaId, ...topicValuesDefault } = copyValues;
const { headers, keySchemaId, valueSchemaId, ...topicValuesDefault } = copyValues;

const keySchema = this.state.keySchema.find(schema => schema.id === keySchemaId);
const valueSchema = this.state.valueSchema.find(schema => schema.id === valueSchemaId);
Expand All @@ -131,10 +131,10 @@ class TopicProduce extends Form {
},
selectedKeySchema: keySchema ? keySchema.subject : '',
selectedValueSchema: valueSchema ? valueSchema.subject : '',
nHeaders: Object.keys(header).length ? 0 : 1
nHeaders: headers.length === 0 ? 1 : 0
});

Object.entries(header).forEach(([key, value]) => this.handlePlus(key, value));
headers.forEach(({key, value}) => this.handlePlus(key, value));
}

doSubmit() {
Expand Down

0 comments on commit 4e17d98

Please sign in to comment.