fix: migrations and discontinue sqlite
This commit is contained in:
parent
c4e547b288
commit
c35b99e0c4
6 changed files with 37 additions and 33 deletions
|
@ -1,7 +1,6 @@
|
|||
import { dataSource } from "../../../data-source";
|
||||
import { setting } from "../../../entity/management/setting";
|
||||
import DatabaseActionException from "../../../exceptions/databaseActionException";
|
||||
import { StringHelper } from "../../../helpers/stringHelper";
|
||||
import { CreateOrUpdateSettingCommand, DeleteSettingCommand } from "./settingCommand";
|
||||
|
||||
export default abstract class SettingCommandHandler {
|
||||
|
@ -11,8 +10,6 @@ export default abstract class SettingCommandHandler {
|
|||
* @returns {Promise<string>}
|
||||
*/
|
||||
static async create(createSetting: CreateOrUpdateSettingCommand): Promise<string> {
|
||||
const token = StringHelper.random(32);
|
||||
|
||||
return await dataSource
|
||||
.createQueryBuilder()
|
||||
.insert()
|
||||
|
@ -25,7 +22,7 @@ export default abstract class SettingCommandHandler {
|
|||
.orUpdate(["value"], ["topic", "key"])
|
||||
.execute()
|
||||
.then((result) => {
|
||||
return token;
|
||||
return createSetting.value;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("CREATE OR UPDATE", "setting", err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue