Skip to content

Commit

Permalink
Fix linked RFP labels for 0 id (#901)
Browse files Browse the repository at this point in the history
* fix linked RFP labels for 0 id

* fix tests

* fix test
  • Loading branch information
Megha-Dev-19 authored Jul 24, 2024
1 parent fbac81e commit d858185
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,10 @@ const onSubmit = ({ isDraft, isCancel }) => {
},
};
const args = {
labels: linkedRfp ? [] : (labels ?? []).map((i) => i.value ?? i),
labels:
typeof linkedRfp === "number"
? []
: (labels ?? []).map((i) => i.value ?? i),
body: body,
};
if (isEditPage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ const editProposal = ({ timeline }) => {
supervisor: supervisor ?? snapshot.supervisor,
};
const args = {
labels: snapshot.linked_rfp ? [] : snapshot.labels,
labels: typeof snapshot.linked_rfp === "number" ? [] : snapshot.labels,
body: body,
id: proposal.id,
};
Expand Down
4 changes: 2 additions & 2 deletions playwright-tests/tests/infrastructure/proposal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test.describe("Wallet is connected as admin", () => {
await expect(transactionText).toEqual(
JSON.stringify(
{
labels: [],
labels: ["Other"],
body: {
proposal_body_version: "V1",
linked_rfp: 0,
Expand Down Expand Up @@ -137,7 +137,7 @@ test.describe("Wallet is connected as admin", () => {
"hemera.near", // author,
"infrastructure-committee.near", // requested_sponsor,
"trechriron71.near", // comment author,
"root.near",
"as2.near",
];
let mentionSuggestions = [];
for (let i = 0; i < liLocators.length; i++) {
Expand Down

0 comments on commit d858185

Please sign in to comment.