mirror of
https://github.com/requarks/wiki.git
synced 2026-08-26 13:17:10 -05:00
fix: esm changes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user