-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
3,207 additions
and
2,498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20 | ||
18.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { JobSchema } from '@magickml/embedder/schema' | ||
import { embedderDb } from 'embedder-db-pg' | ||
|
||
export default defineEventHandler(async event => { | ||
const id = getRouterParam(event, 'id') | ||
|
||
if (!id) { | ||
throw createError({ | ||
statusCode: 400, | ||
message: 'Missing id', | ||
}) | ||
} | ||
|
||
const job = await embedderDb.query.Job.findFirst({ | ||
where: (job, { eq }) => eq(job.id, id), | ||
}) | ||
|
||
if (!job) { | ||
throw createError({ | ||
statusCode: 404, | ||
message: 'Job not found', | ||
}) | ||
} | ||
|
||
// Do something with id | ||
|
||
console.log('Job:', job) | ||
|
||
// return job | ||
return JobSchema.parse(job) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.