mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Update supabase-jobs.ts
This commit is contained in:
parent
2fd9c285bd
commit
234c6daee8
|
@ -1,10 +1,12 @@
|
|||
import { supabase_service } from "../services/supabase";
|
||||
import { Logger } from "./logger";
|
||||
import * as Sentry from "@sentry/node";
|
||||
|
||||
export const supabaseGetJobById = async (jobId: string) => {
|
||||
const { data, error } = await supabase_service
|
||||
.from('firecrawl_jobs')
|
||||
.select('*')
|
||||
.eq('job_id', jobId)
|
||||
.from("firecrawl_jobs")
|
||||
.select("*")
|
||||
.eq("job_id", jobId)
|
||||
.single();
|
||||
|
||||
if (error) {
|
||||
|
@ -16,15 +18,16 @@ export const supabaseGetJobById = async (jobId: string) => {
|
|||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
};
|
||||
|
||||
export const supabaseGetJobsById = async (jobIds: string[]) => {
|
||||
const { data, error } = await supabase_service
|
||||
.from('firecrawl_jobs')
|
||||
.select('*')
|
||||
.in('job_id', jobIds);
|
||||
const { data, error } = await supabase_service.rpc("get_jobs_by_ids", {
|
||||
job_ids: jobIds,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
Logger.error(`Error in get_jobs_by_ids: ${error}`);
|
||||
Sentry.captureException(error);
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -33,5 +36,4 @@ export const supabaseGetJobsById = async (jobIds: string[]) => {
|
|||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user