Added ban/unban endpoint #37
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: gorb/backend#37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wip/ban"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
this doesn't check the user's roles
i'm unsure how far along we are on the roles train, but i know they exist, ask radial
@twig wrote in #37 (comment):
But it does
Added ban endpointto WIP: Added ban endpoint@ -0,0 +3,4 @@
guild_uuid uuid NOT NULL REFERENCES guilds(uuid) ON DELETE CASCADE,
user_uuid uuid NOT NULL REFERENCES users(uuid),
reason VARCHAR(200) DEFAULT NULL,
ban_time TIMESTAMPTZ NOT NULL DEFAULT NOW(),
can you change
ban_time
to be calledbanned_since
instead maybe?WIP: Added ban endpointto Added ban endpointAdded ban endpointto Added ban/unban endpoint@ -171,1 +170,4 @@
let banned = GuildBan::fetch_one(&mut conn, guild_uuid, user_uuid).await;
match banned {
Ok(_) => Err(Error::Forbidden("User banned".to_string())),
This should return a 400 (bad request) on an already banned user, its a bad request as its not forbidden for the user to do it, its just not a possibility for someone to be banned twice
@ -189,3 +195,3 @@
pub async fn delete(self, conn: &mut Conn) -> Result<(), Error> {
delete(guild_members::table)
diesel::delete(guild_members::table)
please just import the delete statement instead of doing
diesel::delete
here so we have consistency in the codebasemerged manually
Pull request closed