1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00

🐛 fix Activity model with body schema

This commit is contained in:
Flam3rboy 2021-04-09 00:36:08 +02:00
parent 2d7e6a5081
commit e5ada80d7e
2 changed files with 41 additions and 3 deletions

View File

@ -46,7 +46,45 @@ export interface Activity {
flags?: bigint;
}
export const Activity = {
export const ActivitySchema = {
name: { type: String, required: true },
type: { type: Number, required: true },
url: String,
created_at: Date,
timestamps: [
{
start: Number,
end: Number,
},
],
application_id: String,
details: String,
state: String,
emoji: {
name: String,
id: String,
amimated: Boolean,
},
party: {
id: String,
size: [Number, Number],
},
assets: {
large_image: String,
large_text: String,
small_image: String,
small_text: String,
},
secrets: {
join: String,
spectate: String,
match: String,
},
instance: Boolean,
flags: BigInt,
};
export const ActivityBodySchema = {
name: String,
type: Number,
$url: String,

View File

@ -1,4 +1,4 @@
import { Activity } from "./Activity";
import { Activity, ActivitySchema } from "./Activity";
import { ClientStatus, Status } from "./Status";
import { Schema, Types, Document } from "mongoose";
import db from "../util/Database";
@ -220,7 +220,7 @@ export const UserSchema = new Schema({
presence: {
status: String,
activities: [Activity],
activities: [ActivitySchema],
client_status: ClientStatus,
},
});