Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
K7theCompSciMan committed Dec 8, 2024
2 parents de9e98b + 51bd7ff commit 6ce55e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .xata/version/compatibility.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"@xata.io/cli":{"latest":"0.15.15","compatibility":[{"range":">=0.0.0"}]},"@xata.io/client":{"latest":"0.29.5","compatibility":[{"range":">=0.0.0"}]}}
{"@xata.io/cli":{"latest":"0.16.12","compatibility":[{"range":">=0.0.0"}]},"@xata.io/client":{"latest":"0.30.1","compatibility":[{"range":">=0.0.0"}]}}
2 changes: 2 additions & 0 deletions api/src/database/user.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { configDotenv } from "dotenv";
import { User } from "../xata";
import { getXataClient } from "../xata";
import bcrypt from "bcryptjs";
import { defaultUserSettings } from "src/models/user.model";

configDotenv();
const xata = getXataClient();
Expand All @@ -17,6 +18,7 @@ export const createUser = async (userData: User): Promise<User | null> => {
const user = await xata.db.user.create({
username: userData.username,
password: hashedPassword,
settings: defaultUserSettings
});
return user;
};
Expand Down
14 changes: 13 additions & 1 deletion api/src/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@ export class UserSettings{
this.primaryCommunicationMethod = settings.primaryCommunicationMethod;
}
}
export default User
export default User

export const defaultUser: PublicUser = {
id: "1",
username: "default",
settings: {
primaryCommunicationMethod: "nats"
}
}

export const defaultUserSettings: UserSettings = {
primaryCommunicationMethod: 'nats'
}
2 changes: 1 addition & 1 deletion api/src/xata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by Xata Codegen 0.29.1. Please do not edit.
// Generated by Xata Codegen 0.30.0. Please do not edit.
import { buildClient } from "@xata.io/client";
import type {
BaseClientOptions,
Expand Down

0 comments on commit 6ce55e1

Please sign in to comment.