mirror of
				https://github.com/drawdb-io/drawdb.git
				synced 2025-11-03 21:26:21 +00:00 
			
		
		
		
	Fix create gist
This commit is contained in:
		@@ -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());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user