Skip to content

Commit edf2062

Browse files
committed
Fix streaming, fix build
1 parent e4a63a3 commit edf2062

File tree

21 files changed

+835
-427
lines changed

21 files changed

+835
-427
lines changed

backend/NXTBackend.API/Controllers/SpotlightController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public async Task<ActionResult<IEnumerable<SpotlightEventDO>>> GetAll(
4040
return Ok(page.Items.Select(item => new SpotlightEventDO(item)));
4141
}
4242

43-
[HttpPost("/spotlights"), Authorize(Roles = "events")]
43+
[HttpPost("/spotlights")]
4444
[EndpointSummary("Create a spotlight")]
4545
[ProducesResponseType(StatusCodes.Status200OK)]
4646
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]

frontend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ vite.config.js.timestamp-*
2121
vite.config.ts.timestamp-*
2222

2323
sonda-*.html
24+
25+
.sonda

frontend/bun.lock

Lines changed: 58 additions & 54 deletions
Large diffs are not rendered by default.

frontend/src/hooks.server.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,6 @@ export const init: ServerInit = async () => {
5151
logger.info("Starting FE...");
5252
};
5353

54-
const errorMiddleware: Middleware = {
55-
onResponse({ response }) {
56-
if (!response.ok) {
57-
// turn a 429, 500, etc into a rejected promise
58-
return Promise.reject("kaka");
59-
// throw new Error(`API error ${response.status} ${response.statusText}`);
60-
}
61-
return response;
62-
}
63-
};
64-
6554
// ============================================================================
6655

6756
const authorizationHandle: Handle = async ({ event, resolve }) => {
@@ -91,9 +80,6 @@ const authorizationHandle: Handle = async ({ event, resolve }) => {
9180
},
9281
},
9382
);
94-
// return error(403, {
95-
// message: "You are not authorized to access this resource.",
96-
// });
9783
}
9884

9985
return resolve(event);
@@ -102,12 +88,11 @@ const authorizationHandle: Handle = async ({ event, resolve }) => {
10288
/** Create the universal api fetch function */
10389
const apiHandle: Handle = async ({ event, resolve }) => {
10490
event.locals.api ??= createClient<BackendRoutes>({
105-
baseUrl: dev ? "http://localhost:3001" : "https://localhost:3000",
91+
baseUrl: dev ? "http://localhost:3001" : "http://localhost:3001",
10692
mode: "cors",
10793
fetch: event.fetch,
10894
});
10995

110-
// event.locals.api.use(errorMiddleware);
11196
return resolve(event);
11297
};
11398

0 commit comments

Comments
 (0)