mirror of
https://github.com/openziti/zrok.git
synced 2025-08-15 10:32:33 +02:00
create/delete organization handlers (#537)
This commit is contained in:
@ -23,6 +23,14 @@ func (str *Store) CreateOrganization(org *Organization, trx *sqlx.Tx) (int, erro
|
||||
return id, nil
|
||||
}
|
||||
|
||||
func (str *Store) FindOrganizationByToken(token string, trx *sqlx.Tx) (*Organization, error) {
|
||||
org := &Organization{}
|
||||
if err := trx.QueryRowx("select * from organizations where token = $1", token).StructScan(org); err != nil {
|
||||
return nil, errors.Wrap(err, "error selecting frontend by token")
|
||||
}
|
||||
return org, nil
|
||||
}
|
||||
|
||||
func (str *Store) DeleteOrganization(id int, trx *sqlx.Tx) error {
|
||||
stmt, err := trx.Prepare("update organizations set updated_at = current_timestamp, deleted = true where id = $1")
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user