Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C catalog.genesys-pgr.org
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Genesys PGR
  • Genesys Catalog
  • catalog.genesys-pgr.org
  • Issues
  • #141
Closed
Open
Created Dec 20, 2017 by Matija Obreza@mobrezaOwner

API uses uuid as reference

When the API returns lists of objects (or perhaps elsewhere) that reference the same object (for example owner of a dataset), the second reference will not be provided as an object in JSON, but only the uuid of the referred-to object.

Example

The owner first provided as an object in the dataset with id 2 (and it has uuid 35c5849a-39d7-400d-a242-726b12c92244).

The second occurrence of the same owner for dataset with id 3 only has a reference "owner": "35c5849a-39d7-400d-a242-726b12c92244".

{
	"content": [{
		"id": 2,
		"version": 7,		
		"uuid": "f5245842-2567-490a-a127-aa35b85d1128",
		"owner": {
			"uuid": "35c5849a-39d7-400d-a242-726b12c92244",
			"id": 1,
			"shortName": "CIP",
			"name": "International Potato Centre",
			"_permissions": {
				"create": true,
				"read": true,
				"write": true,
				"delete": true,
				"manage": true
			}
		},
		...
		"_permissions": {
			"create": true,
			...
		}
	}, {
		"id": 3,
		"version": 6,
		"owner": "35c5849a-39d7-400d-a242-726b12c92244",
		...
	}, {
		"id": 4,
		"version": 5,
		"owner": "35c5849a-39d7-400d-a242-726b12c92244",
		...
	}],
	"totalPages": 1,
	...
}

Update the reducer so that it will map the references and convert them to proper objects.

Without this, the application will break with JS errors.

Assignee
Assign to
Time tracking