@dendelion/paper-camp 0.28.2 → 0.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5797,9 +5797,16 @@ const Jm = async () => (await fetch(N("/api/tasks"))).json(), Zm = async () => (
5797
5797
  throw new Error(l.error);
5798
5798
  }
5799
5799
  return o.json();
5800
- }, lh = async () => (await fetch(N("/api/consistency"))).json(), ih = async () => (await fetch(N("/api/doctor"))).json(), ah = 45e3, sh = async () => (await fetch(N("/api/ideas"), {
5801
- signal: AbortSignal.timeout(ah)
5802
- })).json(), uh = async () => (await fetch(N("/api/archivable-ideas"))).json(), ch = async (e) => {
5800
+ }, lh = async () => (await fetch(N("/api/consistency"))).json(), ih = async () => (await fetch(N("/api/doctor"))).json(), ah = 45e3, sh = async () => {
5801
+ const e = await fetch(N("/api/ideas"), {
5802
+ signal: AbortSignal.timeout(ah)
5803
+ });
5804
+ if (!e.ok) {
5805
+ const t = await e.json().catch(() => ({}));
5806
+ throw new Error(t.error ?? `Failed to load ideas (${e.status})`);
5807
+ }
5808
+ return e.json();
5809
+ }, uh = async () => (await fetch(N("/api/archivable-ideas"))).json(), ch = async (e) => {
5803
5810
  const t = await fetch(N("/api/ideas/archive"), {
5804
5811
  method: "POST",
5805
5812
  headers: { "Content-Type": "application/json" },
@@ -5826,9 +5833,16 @@ const Jm = async () => (await fetch(N("/api/tasks"))).json(), Zm = async () => (
5826
5833
  const e = await fetch(N("/api/parked-questions"));
5827
5834
  if (!e.ok) throw new Error(`Failed to fetch parked questions: ${e.status}`);
5828
5835
  return e.json();
5829
- }, mh = 45e3, ws = async () => (await fetch(N("/api/plans"), {
5830
- signal: AbortSignal.timeout(mh)
5831
- })).json();
5836
+ }, mh = 45e3, ws = async () => {
5837
+ const e = await fetch(N("/api/plans"), {
5838
+ signal: AbortSignal.timeout(mh)
5839
+ });
5840
+ if (!e.ok) {
5841
+ const t = await e.json().catch(() => ({}));
5842
+ throw new Error(t.error ?? `Failed to load plans (${e.status})`);
5843
+ }
5844
+ return e.json();
5845
+ };
5832
5846
  function hh() {
5833
5847
  const [e, t] = S.useState(null), r = S.useCallback(async () => {
5834
5848
  try {