-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve Action update behavior, and add the ability to delete an action #67
Conversation
status_changed_at timestamptz | ||
created_at timestamp [not null, default: `now()`] | ||
updated_at timestamp [not null, default: `now()`] | ||
status_changed_at timestamptz [not null, default: `now()`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, I think this will set status_changed_at
to "now" when we first create an action. Which might be somewhat misleading for newly created actions. TBH that seems reasonable to me but want to make sure that was your intention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question to double check. Yes, this is intentional. It's because we don't have a non-state option for Status
. If we did, I'd leave this as something we could leave unset. The way I tweaked things in this PR and the frontend one for actions is the "not_started" enum is chosen by default, so it is being set.
Thoughts?
("id" = i32, Path, description = "Action id to delete") | ||
), | ||
responses( | ||
(status = 200, description = "Successfully deleted a certain Action by its id", body = [i32]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the function as returning
{
"data": {
"id": {id}
}
}
If that is the case maybe we could either:
- Define a data structure that reflects that and use it as a schema for
body =
here or - Just return the full deleted object
I want to say I've seen the latter but I don't have strong feelings about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can update this later if you're cool with that, but this is how all of our deletes work today, so I'm just copying them. I'd much rather return the entire thing which is what I do on the frontend anyway.
7e0c6c4
to
b0ab5bb
Compare
Description
This PR improves Actions update behavior, and add the ability to delete an action.
NOTE Make sure to rerun the scripts/rebuild_db.sh script and re-seed the DB with cargo run --bin seed_db
GitHub Issue: None
Changes
Testing Strategy
scripts/rebuild_db.sh
script and re-seed the DB withcargo run --bin seed_db
Concerns
None