Closed PanagiotisVakalis closed 7 years ago
I managed to overcome this issue by creating a new function in the Spine class:
saveWithMeta<T: Resource>(_ resource: T) -> Future<(resource: T, meta: Metadata?, jsonapi: JSONAPIData?), SpineError>
.
Using this function I can now use any top level meta which I am getting from the server.
@wvteijlingen what do you think about this approach?
Our server sends a new token once the current token has been expired. This is being received through the JSON in meta, which is being returned by the server. I can retrieve the new token through meta during the find - GET request. I want to do the same on the save - POST / PATCH. I can see the new token through the debug, but I cannot get it in the
onSuccess
closure.I have a method called
setupSpine(withContentTypeHeader: acceptHeader: andAccepterHeader: )
which returns a Spine object.When I am saving a resource I use
I would like to have the ability to get the meta as I do in the find operation