mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: create idp in postgres
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func (d *DB) CreateIdentityProvider(ctx context.Context, create *store.IdentityProvider) (*store.IdentityProvider, error) {
|
func (d *DB) CreateIdentityProvider(ctx context.Context, create *store.IdentityProvider) (*store.IdentityProvider, error) {
|
||||||
fields := []string{"name", "type", "identifier_filter", "config"}
|
fields := []string{"name", "type", "identifier_filter", "config"}
|
||||||
args := []any{create.Name, create.Type.Type(), create.IdentifierFilter, create.Config}
|
args := []any{create.Name, create.Type.String(), create.IdentifierFilter, create.Config}
|
||||||
stmt := "INSERT INTO idp (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id"
|
stmt := "INSERT INTO idp (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id"
|
||||||
if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(&create.ID); err != nil {
|
if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(&create.ID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user