You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: Controllers/v01/InvoiceController.cs
+9-16Lines changed: 9 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -136,9 +136,9 @@ public async Task<IActionResult> Add([FromBody] InvoiceWrapperModel wrapper)
136
136
if(newInvoice.Id!=0)
137
137
returnnewBadRequestObjectResult(ResponseMgr.CreateResponse(400,traceId,"You are not allowed to set the Id!",newDictionary<string,object>{{"id",newInvoice.Id}}));
138
138
139
-
//check if the user already set an file id
140
-
if(!string.IsNullOrEmpty(newInvoice.FileID))
141
-
returnnewBadRequestObjectResult(ResponseMgr.CreateResponse(400,traceId,"You are not allowed to set the FileID!",newDictionary<string,object>{{"fileId",newInvoice.FileID}}));
139
+
//check if the user has set a file id
140
+
if(String.IsNullOrWhiteSpace(newInvoice.FileID))
141
+
returnnewBadRequestObjectResult(ResponseMgr.CreateResponse(400,traceId,"You have to set an File Id!",newDictionary<string,object>{{"fileId",newInvoice.FileID}}));
returnnewCreatedAtActionResult("Get","Invoice",new{id=newInvoice.Id},ResponseMgr.CreateResponse(201,traceId,"Invoice created successfully",newDictionary<string,object>{{"invoice",newInvoice}}));
195
-
196
185
}
197
186
}
198
187
@@ -240,6 +229,10 @@ public async Task<IActionResult> Edit([FromBody] InvoiceModel editInvoice)
returnnewBadRequestObjectResult(ResponseMgr.CreateResponse(400,traceId,"The file id was manipulated",newDictionary<string,object>{{"fileId",editInvoice.FileID}}));
0 commit comments