This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Tag
Matthias Rohmer edited this page Oct 1, 2021
·
2 revisions
Organizer, Location and Offer can all be tagged with a list of shared tags.
interface Tag {
id: number;
type: "tag";
relations: {
translations: [
{
id: number;
type: "tagtranslation";
attributes: {
language: "de" | "en";
name: string;
};
}
];
};
}
To add a tag to another resource you can send a list of tag IDs a long with other a POST
or PATCH
request to any of the main resource routes. For example to add the tags with the IDs 4 and 7 to the already existing organizer with the ID cku5dqtqj00001lgl4w8ga9z6
send a PATCH
request to /v1/organizer/cku5dqtqj00001lgl4w8ga9z6
with the following body:
{
"relations": {
"tags": [4, 7]
}
}
Important: this operation is destructive and replaces potentially already existing tags.
Parameters | Values |
---|---|
- | - |
{
"data": [
{
"id": 1,
"type": "tag",
"attributes": {},
"relations": {
"translations": [
{
"id": 1,
"type": "tagtranslation",
"attributes": {
"language": "de",
"name": "molestiae"
}
}
]
}
},
{
"id": 2,
"type": "tag",
"attributes": {},
"relations": {
"translations": [
{
"id": 2,
"type": "tagtranslation",
"attributes": {
"language": "de",
"name": "iste"
}
}
]
}
},
{
"id": 3,
"type": "tag",
"attributes": {},
"relations": {
"translations": [
{
"id": 3,
"type": "tagtranslation",
"attributes": {
"language": "de",
"name": "quaerat"
}
}
]
}
}
],
"meta": {
"language": "de"
}
}