feat: activate api service query
This commit is contained in:
@ -12,6 +12,18 @@ import (
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const activateApiService = `-- name: ActivateApiService :exec
|
||||
UPDATE api_services
|
||||
SET is_active = true,
|
||||
updated_at = NOW()
|
||||
WHERE client_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) ActivateApiService(ctx context.Context, clientID string) error {
|
||||
_, err := q.db.Exec(ctx, activateApiService, clientID)
|
||||
return err
|
||||
}
|
||||
|
||||
const createApiService = `-- name: CreateApiService :one
|
||||
INSERT INTO api_services (
|
||||
client_id, client_secret, name, description, redirect_uris, scopes, grant_types, is_active
|
||||
|
@ -38,6 +38,12 @@ SET is_active = false,
|
||||
updated_at = NOW()
|
||||
WHERE client_id = $1;
|
||||
|
||||
-- name: ActivateApiService :exec
|
||||
UPDATE api_services
|
||||
SET is_active = true,
|
||||
updated_at = NOW()
|
||||
WHERE client_id = $1;
|
||||
|
||||
-- name: UpdateClientSecret :exec
|
||||
UPDATE api_services
|
||||
SET client_secret = $2,
|
||||
|
Reference in New Issue
Block a user