mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: enable soft delete for organizations (#16584)
- Add deleted column to organizations table - Add trigger to check for existing workspaces, templates, groups and members in a org before allowing the soft delete --------- Co-authored-by: Steven Masley <stevenmasley@gmail.com> Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
This commit is contained in:
co-authored by
Steven Masley
Steven Masley
parent
dfa33b11d9
commit
546a549dcf
@@ -258,7 +258,9 @@ func parseOrganization(ctx context.Context, db database.Store, parser *httpapi.Q
|
||||
if err == nil {
|
||||
return organizationID, nil
|
||||
}
|
||||
organization, err := db.GetOrganizationByName(ctx, v)
|
||||
organization, err := db.GetOrganizationByName(ctx, database.GetOrganizationByNameParams{
|
||||
Name: v, Deleted: false,
|
||||
})
|
||||
if err != nil {
|
||||
return uuid.Nil, xerrors.Errorf("organization %q either does not exist, or you are unauthorized to view it", v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user