Skip to content

Commit

Permalink
save thing
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Jan 11, 2024
1 parent 61a774e commit 9bd2759
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions apps/editor/widget/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ function PanelHeader({
{adapters &&
adapters.map((it) => <Option value={it.value}>{it.label}</Option>)}
</Select>
<Button
disabled={!value}
onClick={() =>
adapter.create({ [value]: { post: { main: editorValue } } })
}
>
<Button disabled={!value} onClick={() => adapter.create(value)}>
Publish
</Button>
</div>
Expand All @@ -109,7 +104,28 @@ const socialDbAdapter = {
return Social.get(path, blockHeight);
},
create: (v) => {
return Social.set(v, { force: true });
const id = "routes";
return Social.set(
{
thing: {
[id]: {
"": v,
metadata: {
type: "app",
},
},
},
},
{
force: "true",
onCommit: (v) => {
console.log(v);
},
onCancel: (v) => {
console.log(v);
},
}
);
},
};

Expand Down

0 comments on commit 9bd2759

Please sign in to comment.