前端项目实战104-postgrest中getone详情查询

getOne: (resource: any, params: any) => {
const key: any = Object.keys(params)
const id = params[key[0]];
const primaryKey = getPrimaryKey(resource, primaryKeys);
const query = getQuery(primaryKey, id, resource);
//转换id
const url = `${PostgrestUrl}/${resource}?${query.replace("id", key[0])}&is_delete=eq.0`;
return httpClient(url, {
headers: new Headers({}),
}).then(({ json }) => ({
data: dataWithId(json, primaryKey),
})).catch((err) => {
return err
})
},

 postGrest().getOne('search_holiday_detail',{holiday_id:id}).then((response:any)=>

根据id进行查询

posted @   前端导师歌谣  阅读(28)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示