Skip to content

Commit

Permalink
Fix file previews in the requestor response panel (#312)
Browse files Browse the repository at this point in the history
* Fix file previews in requestor

* Factor our ResponseBodyText

* Factor out FailedRequest

* Add support for rendering audio

* Merge changelogs

* Add comment about isRequestorActiveResponse
  • Loading branch information
brettimus authored Oct 9, 2024
1 parent 3ae173e commit feb5ee6
Show file tree
Hide file tree
Showing 9 changed files with 436 additions and 342 deletions.
23 changes: 22 additions & 1 deletion examples/goose-quotes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Hono, type HonoRequest } from "hono";

import { instrument, measure } from "@fiberplane/hono-otel";
import { neon } from "@neondatabase/serverless";
import { asc, eq, ilike } from "drizzle-orm";
import { asc, eq, ilike, isNull, not } from "drizzle-orm";
import { drizzle } from "drizzle-orm/neon-http";

import {
Expand Down Expand Up @@ -72,6 +72,27 @@ app.get("/api/geese", async (c) => {
return c.json(searchResults);
});

/**
* Search for geese with avatars
*/
app.get("/api/geese-with-avatar", async (c) => {
const sql = neon(c.env.DATABASE_URL);
const db = drizzle(sql);

console.log("Fetching geese with avatars");

const geeseWithAvatars = await measure("getGeeseWithAvatars", () =>
db
.select()
.from(geese)
.where(not(isNull(geese.avatar)))
.orderBy(asc(geese.id)),
)();

console.log(`Found ${geeseWithAvatars.length} geese with avatars`);
return c.json(geeseWithAvatars.map((g) => g.id));
});

/**
* Create a Goose and return the Goose
*
Expand Down
340 changes: 0 additions & 340 deletions studio/src/pages/RequestorPage/ResponsePanel/ResponseBody.tsx

This file was deleted.

Loading

0 comments on commit feb5ee6

Please sign in to comment.