Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! feat: add audit logs for dormancy events
  • Loading branch information
coadler committed Oct 30, 2024
commit 7d2b5323e93720d85a1b7ae3f58e14e520c5121b
6 changes: 5 additions & 1 deletion coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion coderd/database/queries/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ INSERT INTO
status
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, NULLIF(@status::text, '')::user_status) RETURNING *;
($1, $2, $3, $4, $5, $6, $7, $8, $9,
-- if the status passed in is empty, fallback to dormant, which is what
-- we were doing before.
COALESCE(NULLIF(@status::text, '')::user_status, 'dormant'::user_status)
) RETURNING *;
Comment on lines +74 to +78
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we handle this as a special case? Shouldn't we expect the status to be provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't really want to leak the previous default behavior out into the API code. I think it makes more sense to do the default behavior here, which is what was happening before when it wasn't being inserted.


-- name: UpdateUserProfile :one
UPDATE
Expand Down
1 change: 1 addition & 0 deletions site/e2e/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const createUser = async (orgId: string) => {
password: "s3cure&password!",
login_type: "password",
organization_ids: [orgId],
user_status: "dormant"
});
return user;
};
Expand Down
Loading