osmlab / to-fix-backend

The to-fix server
BSD 3-Clause "New" or "Revised" License
15 stars 13 forks source link

Create Tags endpoints #140

Closed emilymdubois closed 6 years ago

emilymdubois commented 7 years ago

Here are the endpoints I think we'll need for project and item tags with the available query and parameter options. One thing that I'm navigating is when to use the following:

Below, all instances of :tag can be assumed to mean tag ID, and all instances of tag can be assumed to mean tag name. Would love thoughts from other stakeholders!

@batpad @kepta @samanpwbb


Get all tags for project

GET /project/:project/tags

Query parameters

Name Type Description
tag string Optional. May be passed to filter returned tags where tag name contains the provided string.

Create a project tag

POST /project/:project/tags

Payload parameters

Name Type Description
name string Required. The tag name.

Get a project tag

GET /project/:project/tags/:tag

Update a project tag

PUT /project/:project/tags/:tag

Payload parameters

Name Type Description
name string Required. The new tag name.

Delete a project tag

DELETE /project/:project/tags/:tag

Get all tags for item

GET /project/:project/item/:item/tags

Query parameters

Name Type Description
tag string Optional. May be passed to filter returned tags where tag name contains the provided string.

Add a tag to an item

POST /project/:project/item/:item/tags

Payload parameters

Name Type Description
tagIds array Required. An array of tag IDs to add to the item.

Delete a tag from an item

DELETE /project/:project/item/:item/tags/:tag
batpad commented 6 years ago

This is done! Let's create separate issues if there's specifics that need changing.