summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-27 17:39:52 +0200
committerKyren223 <Kyren223@proton.me>2024-11-27 17:39:52 +0200
commit6a5131792f45b4494c9db727b1344becb742a488 (patch)
treedcfb9ef5a9638e1f76f3a026f13c5776bd2dd05e
parentbe22bb89db0b952ea0545e7c65b46e92ebb205d2 (diff)
Fixed minor issues on the server
-rw-r--r--internal/server/api/api.go2
-rw-r--r--migrations/20241026174345_init.sql2
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/server/api/api.go b/internal/server/api/api.go
index f320838..7dcf1ab 100644
--- a/internal/server/api/api.go
+++ b/internal/server/api/api.go
@@ -83,7 +83,7 @@ func CreateOrGetUser(ctx context.Context, node *snowflake.Node, pubKey ed25519.P
return user, nil
}
-func CreateNetwork(ctx context.Context, sess *session.Session, request packet.CreateNetwork) packet.Payload {
+func CreateNetwork(ctx context.Context, sess *session.Session, request *packet.CreateNetwork) packet.Payload {
name := strings.TrimSpace(request.Name)
if name == "" {
return &packet.Error{Error: "server name must not be blank"}
diff --git a/migrations/20241026174345_init.sql b/migrations/20241026174345_init.sql
index f7cedd8..02fdee8 100644
--- a/migrations/20241026174345_init.sql
+++ b/migrations/20241026174345_init.sql
@@ -18,7 +18,7 @@ CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
public_key BLOB NOT NULL UNIQUE,
- description TEXT NOT NULL,
+ description TEXT NOT NULL DEFAULT '',
is_public_dm BOOLEAN NOT NULL CHECK (is_public_dm IN (false, true)) DEFAULT true,
is_deleted BOOLEAN NOT NULL CHECK (is_deleted IN (false, true)) DEFAULT false
);