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:
parent
2d7e6a5081
commit
e5ada80d7e
@ -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,
|
||||
|
@ -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,
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user