Skip to content

Commit

Permalink
minor reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed Oct 30, 2024
1 parent f94faf8 commit dbda846
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "RESTful API for disc golf discs.",
"author": "Chris Leveille <[email protected]",
"license": "MIT",
"module": "./src/index.ts",
"type": "module",
"repository": {
"module": "./src/index.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/cdleveille/discit-api.git"
},
Expand Down
15 changes: 15 additions & 0 deletions src/helpers/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import { Schema } from "mongoose";
import { z } from "zod";

import type { TBase } from "@types";

export const BaseSchema = new Schema<TBase>({
created_at: {
type: Date,
default: () => Date.now(),
immutable: true
},
updated_at: {
type: Date,
default: () => Date.now()
}
});

export const discSchema = z.object({
id: z.string(),
name: z.string(),
Expand Down
16 changes: 1 addition & 15 deletions src/helpers/util.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
import { Schema } from "mongoose";

import type { TBase, TDisc, TDiscQuery } from "@types";

export const BaseSchema = new Schema<TBase>({
created_at: {
type: Date,
default: () => Date.now(),
immutable: true
},
updated_at: {
type: Date,
default: () => Date.now()
}
});
import type { TDisc, TDiscQuery } from "@types";

export const newId = () => crypto.randomUUID();

Expand Down

0 comments on commit dbda846

Please sign in to comment.