mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-05-24 10:29:11 +00:00
Fix create gist
This commit is contained in:
parent
66f41d591a
commit
1a80ac539a
@ -13,7 +13,7 @@ export async function create(content) {
|
|||||||
content,
|
content,
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.id;
|
return res.data.data.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function patch(gistId, content) {
|
export async function patch(gistId, content) {
|
||||||
|
@ -69,8 +69,8 @@ export default function Share({ title, setModal }) {
|
|||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
if (!gistId || gistId === "") {
|
if (!gistId || gistId === "") {
|
||||||
const res = await create(diagramToString());
|
const id = await create(diagramToString());
|
||||||
setGistId(res.data.id);
|
setGistId(id);
|
||||||
} else {
|
} else {
|
||||||
await patch(gistId, diagramToString());
|
await patch(gistId, diagramToString());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user