You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wiki/server/modules/storage/db/storage.mjs

26 lines
608 B

import fs from 'node:fs/promises'
export default {
async activated () { },
async deactivated () { },
async init () { },
async created (page) { },
async updated (page) { },
async deleted (page) { },
async renamed (page) { },
async assetUploaded ({ asset, tempFilePath, createReadStream }) {
await WIKI.db.knex('assets').where({
id: asset.id
}).update({
data: await fs.readFile(tempFilePath)
})
return {
available: true
}
},
async assetDeleted (asset) { },
async assetRenamed (asset) { },
async getLocalLocation () { },
async exportAll () { }
}