correctly gets unredactor
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 15s
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 15s
This commit is contained in:
parent
47cea68e04
commit
5e1cf0a83b
2 changed files with 16 additions and 8 deletions
|
|
@ -5,11 +5,14 @@ class Redactor {
|
|||
const storedKey = localStorage.getItem("key");
|
||||
if (!storedKey) throw new Error("Missing key");
|
||||
|
||||
let jsonKey = JSON.stringify({ key: storedKey });
|
||||
console.log("Requesting unredactor.json with: " + jsonKey);
|
||||
|
||||
const hashResJson = await (
|
||||
await fetch("http://api.deprived.dev/unredact", {
|
||||
await fetch("http://localhost:8000/unredact", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ key: storedKey }),
|
||||
body: jsonKey,
|
||||
})
|
||||
).json();
|
||||
|
||||
|
|
@ -25,9 +28,7 @@ class Redactor {
|
|||
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
const data = await res.json();
|
||||
const item = data?.items?.[0];
|
||||
const raw = JSON.parse(item.file);
|
||||
return parseProfile(raw);
|
||||
return parseProfile(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue