mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-04-24 23:27:04 -05:00
added SettingsData type
This commit is contained in:
parent
ff104b496f
commit
32c662db41
|
|
@ -1,4 +1,5 @@
|
|||
import { Schema, model } from 'mongoose';
|
||||
import { SettingsData } from '@/types/miiverse/settings';
|
||||
import { HydratedSettingsDocument, ISettings, ISettingsMethods, SettingsModel } from '@/types/mongoose/settings';
|
||||
|
||||
const SettingsSchema = new Schema<ISettings, SettingsModel, ISettingsMethods>({
|
||||
|
|
@ -48,7 +49,7 @@ const SettingsSchema = new Schema<ISettings, SettingsModel, ISettingsMethods>({
|
|||
}
|
||||
});
|
||||
|
||||
SettingsSchema.method<HydratedSettingsDocument>('json', function json(): Record<string, any> {
|
||||
SettingsSchema.method<HydratedSettingsDocument>('json', function json(): SettingsData {
|
||||
return {
|
||||
pid: this.pid,
|
||||
screen_name: this.screen_name
|
||||
|
|
|
|||
4
src/types/miiverse/settings.ts
Normal file
4
src/types/miiverse/settings.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export type SettingsData = {
|
||||
pid: number;
|
||||
screen_name: string;
|
||||
};
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import { Model, HydratedDocument } from 'mongoose';
|
||||
import { SettingsData } from '@/types/miiverse/settings';
|
||||
|
||||
export interface ISettings {
|
||||
pid: number;
|
||||
|
|
@ -18,7 +19,7 @@ export interface ISettings {
|
|||
}
|
||||
|
||||
export interface ISettingsMethods {
|
||||
json(): Record<string, any>;
|
||||
json(): SettingsData;
|
||||
}
|
||||
|
||||
interface ISettingsQueryHelpers {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user