mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
fix: prompt input
This commit is contained in:
parent
0571924dc1
commit
5e2657d742
@ -82,7 +82,7 @@ export const PromptInput = () => {
|
||||
|
||||
if (match && match[1]) {
|
||||
const extractedString = match[1];
|
||||
updateJson(extractedString);
|
||||
await updateJson(extractedString);
|
||||
toast.success(`${data.credits} credits left for today.`);
|
||||
} else {
|
||||
throw Error("An error occured while parsing result.");
|
||||
|
@ -14,7 +14,7 @@ const useJsonQuery = () => {
|
||||
const updateJson = async (query: string, cb?: () => void) => {
|
||||
try {
|
||||
const jq = await import("jq-web");
|
||||
const res = jq.json(JSON.parse(getJson()), query);
|
||||
const res = await jq.promised.json(JSON.parse(getJson()), query);
|
||||
|
||||
setContents({ contents: JSON.stringify(res, null, 2) });
|
||||
cb?.();
|
||||
|
Loading…
x
Reference in New Issue
Block a user