简体   繁体   English

通过文件上传功能loopback4中的一个请求api将数据插入4个端点

[英]Insert data in to 4 endpoints via one request api in fileupload feature loopback4

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

I dont how to do that , could you please tell me the way or share me any reference links我不知道怎么做,你能告诉我方法或分享任何参考链接吗?

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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM