add request to personal information

This commit is contained in:
kandrusyak
2023-08-03 02:13:48 +03:00
parent 0364ad2d7d
commit d4ccd4d11b

View File

@@ -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,