Skip to content

Commit

Permalink
Merge pull request #54 from useplunk/dev-driaug-contact-update
Browse files Browse the repository at this point in the history
Fix: Contact not properly resetting on load
  • Loading branch information
driaug authored Aug 14, 2024
2 parents 84a14b5 + e0f038b commit 094d7b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/dashboard/src/pages/contacts/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ export default function Index() {
return;
}

reset(contact);
reset({
email: contact.email,
subscribed: contact.subscribed,
});
dataReset({
data: Object.entries(JSON.parse(contact.data ? contact.data : "{}")).map(([key, value]) => ({
value: { key, value },
Expand Down Expand Up @@ -133,7 +136,6 @@ export default function Index() {

toast.promise(
network.mock<Contact, typeof ContactSchemas.manage>(project.secret, "PUT", "/v1/contacts", {
id: contact.id,
...data,
data: dataObject,
}),
Expand Down

0 comments on commit 094d7b2

Please sign in to comment.