add request to personal information
This commit is contained in:
@@ -52,17 +52,17 @@ func CreatePerson(person model.PersonalInformationCreate, header http.Header) (*
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetPersons(ids []uuid.UUID, header http.Header) (map[uuid.UUID]model.PersonalInformation, error) {
|
func GetPersons(ids []uuid.UUID, header http.Header) (map[uuid.UUID]model.PersonalInformation, error) {
|
||||||
type BatchBody struct {
|
|
||||||
ids []uuid.UUID
|
|
||||||
}
|
|
||||||
|
|
||||||
var persons []model.PersonalInformation
|
var persons []model.PersonalInformation
|
||||||
personsMap := make(map[uuid.UUID]model.PersonalInformation)
|
personsMap := make(map[uuid.UUID]model.PersonalInformation)
|
||||||
|
|
||||||
jsonIds, err := json.Marshal(&BatchBody{
|
jsonIds, err := json.Marshal(&map[string][]uuid.UUID{
|
||||||
ids: ids,
|
"ids": ids,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
data, err, req := api.PostRequest(
|
data, err, req := api.PostRequest(
|
||||||
config.Env.MSHosts.PersonsHost+"/persons/batch/",
|
config.Env.MSHosts.PersonsHost+"/persons/batch/",
|
||||||
jsonIds,
|
jsonIds,
|
||||||
|
|||||||
Reference in New Issue
Block a user