Find Jobs
Hire Freelancers

Attempting to pass JSON body for deletion through angular JS -- 4

£10-20 GBP

已关闭
已发布大约 4 年前

£10-20 GBP

货到付款
Attempting to pass JSON body for deletion through angular JS I've currently got an endpoint that relies on a JSON body in order for deletion to happen. This is the following code: if ([login to view URL] > 0) { var deleteRequest = []; for (var i = 0; i < [login to view URL]; i++) { var service = {}; [login to view URL] = $[login to view URL][toDeleteService[i]].serviceId; [login to view URL](service); } var deleteUrl = "api/class/" + $scope.targetEntity.serviceId+ "/student"; await asyncDeleteUrl(deleteUrl, deleteRequest); } async function asyncDeleteUrl(deleteUrl, toBeDeleted) { return new Promise(function (resolve, reject) { $[login to view URL](deleteUrl, toBeDeleted) .then(function (response) { resolve(response); }, function (errorResponse) { reject(errorResponse); $[login to view URL]('Bad Modification Interrupted', errorResponse); }); }); } I keep getting an error saying the required rest body is missing but I'm not sure why that would be the case. Any help would be appreciated, thank you.
项目 ID: 24008775

关于此项目

4提案
远程项目
活跃4 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
4威客以平均价£11 GBP来参与此工作竞价
用户头像
I would like to help you right now, I am available right now, send me a message to continue greetings, I ALREADY HAVE THE MISTAKE.
£10 GBP 在1天之内
5.0 (7条评论)
3.9
3.9
用户头像
Hi, I am full stack developer that has more than 8 years of experience. I have inspected your code, if this is all the code that you are using , it looks like you send "deleteRequest" parameter as an empty array to "asyncDeleteUrl" function. It may the reason of the error
£10 GBP 在2天之内
5.0 (1条评论)
0.0
0.0
用户头像
I think what your are trying to do is push the service object that you created inside the loop in the delete request, because with the current code that you are using the deleteRequest array is empty.
£10 GBP 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

GERMANY的国旗
Belfast, Germany
5.0
1
付款方式已验证
会员自11月 11, 2019起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。