mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
Implement setup task for worker admin environment and add new database schema and snapshot files
This commit is contained in:
@@ -461,7 +461,8 @@ app.post("/api/v1/admin/chat/messages", async (c) => {
|
||||
app.post("/api/v1/admin/context-items", async (c) => {
|
||||
const body = await parseBody(c)
|
||||
const userId = typeof body.userId === "string" ? body.userId.trim() : ""
|
||||
const type = typeof body.type === "string" ? body.type.trim() : ""
|
||||
const type =
|
||||
typeof body.type === "string" ? body.type.trim().toLowerCase() : ""
|
||||
const url = typeof body.url === "string" ? body.url.trim() : null
|
||||
const name =
|
||||
typeof body.name === "string" && body.name.trim()
|
||||
@@ -537,7 +538,7 @@ app.patch("/api/v1/admin/context-items/:itemId", async (c) => {
|
||||
|
||||
if (typeof body.name === "string") updates.name = body.name
|
||||
if (typeof body.type === "string") {
|
||||
const nextType = body.type.trim()
|
||||
const nextType = body.type.trim().toLowerCase()
|
||||
if (nextType !== "url" && nextType !== "file") {
|
||||
return c.json({ error: "type must be 'url' or 'file'" }, 400)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user