mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 16:30:58 -05:00
Remove unused functions in models directory
This commit is contained in:
parent
fcfd11431a
commit
ef1b395352
@ -55,9 +55,6 @@ export class MPServerSvc {
|
|||||||
})
|
})
|
||||||
this.model.sync();
|
this.model.sync();
|
||||||
}
|
}
|
||||||
async getServers() {
|
|
||||||
return await this.model.findAll();
|
|
||||||
}
|
|
||||||
async fetchPlayerData(serverName:string) {
|
async fetchPlayerData(serverName:string) {
|
||||||
const findServerByName = await this.model.findOne({where: {serverName: serverName}});
|
const findServerByName = await this.model.findOne({where: {serverName: serverName}});
|
||||||
if (findServerByName) return findServerByName.dataValues.playerData;
|
if (findServerByName) return findServerByName.dataValues.playerData;
|
||||||
@ -118,14 +115,4 @@ export class MPServerSvc {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
async getServerData(serverName:string):Promise<IServer> {
|
|
||||||
return new Promise(async resolve=>{
|
|
||||||
const serverInfo = await this.findInCache();
|
|
||||||
|
|
||||||
for (let i = 0; i < serverInfo.length; i++) {
|
|
||||||
if (serverInfo[i].serverName === serverName) resolve(serverInfo[i]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,6 @@ export class DailyMsgsSvc {
|
|||||||
return await this.model.findAll();
|
return await this.model.findAll();
|
||||||
// Fetch every rows from database.
|
// Fetch every rows from database.
|
||||||
}
|
}
|
||||||
async fetchSpecificDay(dayId:number) {
|
|
||||||
return await this.model.findOne({where: {day: dayId}});
|
|
||||||
// Fetch a specific row from database by id column.
|
|
||||||
}
|
|
||||||
async newDay(formattedDate:number, total:number) {
|
async newDay(formattedDate:number, total:number) {
|
||||||
if (await this.model.findOne({where: {day: formattedDate}})) return console.log('This day already exists!')
|
if (await this.model.findOne({where: {day: formattedDate}})) return console.log('This day already exists!')
|
||||||
return await this.model.create({day: formattedDate, total: total});
|
return await this.model.create({day: formattedDate, total: total});
|
||||||
|
Loading…
Reference in New Issue
Block a user