Closed kgoedecke closed 8 years ago
@kgoedecke thank you for posting the issue! I agree that uploadWithSuccess
and uploadWithName
should have returned the LBFile
object based on the server response, since the server does return such info. I'll check out the PR asap.
@kgoedecke thanks for the PR! Now the PR has been merged and the issue has been fixed. I'm going to close this.
I feel like it would be helpful if uploadWithName would pass the actual HTTP Response into the success callback or even an LBFile object.
https://github.com/strongloop/loopback-sdk-ios/blob/master/LoopBack/LBFile.m#L188
For example I'm converting the filename on the server side to a random hash value, and I need the HTTP response to let the client side know what the new filename is.
I suggest the following: In L188 in LBFile.m convert the
id value
to an actual LBFile object and pass it into success (Sadly we can't use modelWithDictionary, as the dictionary looks a little different as the one from thegetFileWithName
for example). I'll try to workout the details and open a PR soon, for now I'd appreciate what you guys think about this especially on how to convert the value to a LBFile.