fix: esm changes

pull/6775/head
NGPixel 2 years ago
parent 8f94449426
commit 532e5c99ab
No known key found for this signature in database
GPG Key ID: B755FB6870B30F63

@ -6,7 +6,7 @@ import cronparser from 'cron-parser'
import { DateTime } from 'luxon'
import { v4 as uuid } from 'uuid'
import { createDeferred } from '../helpers/common.mjs'
import { find, remove } from 'lodash-es'
import { camelCase, find, remove } from 'lodash-es'
export default {
workerPool: null,
@ -27,7 +27,7 @@ export default {
})
this.tasks = {}
for (const f of (await fs.readdir(path.join(WIKI.SERVERPATH, 'tasks/simple')))) {
const taskName = f.replace('.mjs', '')
const taskName = camelCase(f.replace('.mjs', ''))
this.tasks[taskName] = (await import(path.join(WIKI.SERVERPATH, 'tasks/simple', f))).task
}
return this

@ -2,7 +2,7 @@ import _ from 'lodash-es'
import util from 'node:util'
import getosSync from 'getos'
import os from 'node:os'
import filesize from 'filesize'
import { filesize } from 'filesize'
import path from 'node:path'
import fs from 'fs-extra'
import { DateTime } from 'luxon'

@ -122,6 +122,7 @@ export default {
},
async updateUser (obj, args) {
try {
console.info(args.id)
await WIKI.db.users.updateUser(args.id, args.patch)
return {

@ -642,7 +642,7 @@ export class User extends Model {
*
* @param {Object} param0 User ID and fields to update
*/
static async updateUser ({ id, email, name, newPassword, groups, location, jobTitle, timezone, dateFormat, appearance }) {
static async updateUser (id, { email, name, newPassword, groups, location, jobTitle, timezone, dateFormat, appearance }) {
const usr = await WIKI.db.users.query().findById(id)
if (usr) {
let usrData = {}

@ -56,7 +56,7 @@ export default {
background = { r: 0, g: 0, b: 0, alpha: 0 },
kernel = 'lanczos3'
}) {
this.load()
await this.load()
if (inputPath) {
inputStream = fse.createReadStream(inputPath)

Loading…
Cancel
Save