Hands-On Swift 5 Microservices Development by Ralph Kuepper

Hands-On Swift 5 Microservices Development by Ralph Kuepper

Author:Ralph Kuepper [Ralph Kuepper]
Language: eng
Format: epub
Tags: COM000000 - COMPUTERS / General, COM082000 - COMPUTERS / Bioinformatics, COM006000 - COMPUTERS / Buyer
Publisher: Packt Publishing
Published: 2020-03-02T11:36:11+00:00


return user.update(on: request.db)

"Doesn't this last line return EventLoopFuture<User> ?", you might wonder. That is correct; we are not entirely done yet. We need to map this to the correct return type.

Write down the following code, right after the last ):

.map { _ in

return UserSuccessResponse(user: UserResponse(user: user))

}

So, the whole line looks like this:

return user.update(on: request.db).map { _ in

return UserSuccessResponse(user: UserResponse(user: user))

}

And that's it: the update function is complete. Now, let's work on the delete function.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.