blob: 6bd9a825cf1f092c2e87e1ab8b7defc16db41333 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
const std = @import("std");
const memora = @import("memora");
const Context = memora.Context;
const Storage = memora.Storage;
pub const access = .admins;
pub const Body = struct {
name: []const u8,
full_name: []const u8,
birthday: []const u8,
password: []const u8,
};
pub fn post(ctx: *Context, body: Body) anyerror!void {
var user = try Storage.User.new(
ctx.storage,
body.name,
body.full_name,
body.birthday,
body.password,
false,
ctx.storage.allocator,
);
defer user.deinit();
try user.sync();
}
|