redacted linkedin
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
c1c3090a2f
commit
2094b85e69
4 changed files with 33 additions and 19 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import { z } from "zod";
|
||||
|
||||
const Link = z.object({
|
||||
imageId: z.string().min(1).optional(),
|
||||
text: z.string().min(1),
|
||||
link: z.string().url(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -40,8 +40,11 @@ class Redactor implements Readable<Profile | undefined> {
|
|||
});
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
|
||||
const data = await res.json();
|
||||
this.unredactedProfile = parseProfile(data.json);
|
||||
let data = await res.json();
|
||||
const replaced = JSON.parse(
|
||||
JSON.stringify(data).replaceAll("[PB]", env.POCKETBASE_URL),
|
||||
);
|
||||
this.unredactedProfile = parseProfile(replaced.json);
|
||||
this.notify(); // <-- tell Svelte to update
|
||||
return this.unredactedProfile;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue