通过文件上传功能环回4中的一个请求API将数据插入到4个端点

发布于 2025-01-16 17:03:12 字数 136 浏览 3 评论 0原文

我已经在环回中使用 multer 磁盘存储上传了文件,这些详细信息我想通过一个 api 请求在 4 个不同的表中创建条目。您能告诉我如何实现这一目标吗?如果您有任何参考链接,请分享,谢谢

我不知道该怎么做,你能告诉我方法或分享给我任何参考链接吗

I have uploaded the files using multer disk storage in loopback ,those details i want to create the entries in 4 different tables via one api request .Could you please tell me how we can achieve this ,Pls share if you any reference links ,Thank you

I dont how to do that , could you please tell me the way or share me any reference links

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蘸点软妹酱 2025-01-23 17:03:12

您可以通过在一个请求中使用多个存储库来实现这一目标,如下所示:

await this.firstRepository.create(data);
await this.secondRepository.create(data);
this.thirdRepository.create(data);

You can achieve this by using multiple repositories in one request like this:

await this.firstRepository.create(data);
await this.secondRepository.create(data);
this.thirdRepository.create(data);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文