Fix create gist

This commit is contained in:
1ilit 2025-04-21 23:00:57 +04:00
parent 66f41d591a
commit 1a80ac539a
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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());
} }