Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IO-1800][internal] Set Priority of items #699

Merged
merged 8 commits into from
Oct 27, 2023
Merged

[IO-1800][internal] Set Priority of items #699

merged 8 commits into from
Oct 27, 2023

Conversation

owencjones
Copy link
Contributor

Problem

The initial set priority had opportunity for some improvements

Solution

Made the improvements

@linear
Copy link

linear bot commented Oct 24, 2023

IO-1800 Core: Edit items: Set priority

https://www.notion.so/v7labs/Item-Management-Functionality-Scoping-df5f846a135e46e1bf31c473afda32ee#c93dd9600c9b47b394df6660276d490d

set_item_priority(client, id, priority)
# client: Client
# id: str, validatable as UUID
# priority: Positive int

payload = {
"priority": priority,
"filters": {
"item_ids": [str(item_id)],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the set priority endpoint can accept a list of item_ids, would it made sense to allow this to as well?

If so, maybe:

  • set_item_priority() accepts item_ids: List[UUID], then:
  • "item_ids": [str(item_id) for item_id in item_ids] at this point

expected_endpoint = "/v2/teams/test-team/items/priority"

# Define the expected response
expected_response = {"status": "success"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but if successful doesn't the endpoint always return {"affected_item_count": n}?

I couldn't get it to return {"status": "success"}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you pass it a 422 inducing load of rubbish, it returns a response including errors

Graphotate.Common.APIError example:

{
  "errors": {
    "code": "EXTERNAL_STORAGE_LIMIT_REACHED",
    "detail": {},
    "message": "Error message",
    "status": 422
  }
}```

@owencjones owencjones merged commit 118c4f4 into master Oct 27, 2023
@owencjones owencjones deleted the io_1800 branch October 27, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants