Author: Not specified Language: javascript
Description: (v20) Timestamp: 2018-06-12 22:09:11 +0000
View raw paste Parent paste by: Not specified - Child paste by: Not specified Reply
  1. fun save(_ users: [User], request: Request) -> [Future<HTTPStatus>] {
  2.     let userSaveResults: [Future<User>] = []
  3.    
  4.     for user in users {
  5.         userSaveResults.append(user.save())
  6.     }
  7.  
  8.     return userSaveResults.flatten(on: request)
  9.         .transform(to: HTTPStatus.created)
  10. }
View raw paste Parent paste by: Not specified - Child paste by: Not specified Reply