base: Slight changes
This commit is contained in:
parent
857a087410
commit
16b87aabcf
4 changed files with 5 additions and 5 deletions
|
@ -77,6 +77,7 @@ export default class ArticleRoutes {
|
||||||
params = params.concat(mediaToDatabase(banner, body.remove_banner === 'true'))
|
params = params.concat(mediaToDatabase(banner, body.remove_banner === 'true'))
|
||||||
params = params.concat(mediaToDatabase(media, body.remove_media === 'true'))
|
params = params.concat(mediaToDatabase(media, body.remove_media === 'true'))
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = await ctx.db.safeCallProc('article_auth_get_update_create', params)
|
let res = await ctx.db.safeCallProc('article_auth_get_update_create', params)
|
||||||
|
|
||||||
ctx.body = this.private_getUpdateArticle_resOutput(res)
|
ctx.body = this.private_getUpdateArticle_resOutput(res)
|
||||||
|
|
|
@ -53,6 +53,7 @@ nconf.defaults({
|
||||||
"iss": "dev",
|
"iss": "dev",
|
||||||
"path": "https://media.nfp.is/media/resize",
|
"path": "https://media.nfp.is/media/resize",
|
||||||
"filePath": "https://media.nfp.is/media",
|
"filePath": "https://media.nfp.is/media",
|
||||||
|
"directFilePath": "https://media.nfp.is/media/noprefix",
|
||||||
"removePath": "https://media.nfp.is/media/",
|
"removePath": "https://media.nfp.is/media/",
|
||||||
"preview": {
|
"preview": {
|
||||||
"out": "base64",
|
"out": "base64",
|
||||||
|
|
|
@ -15,8 +15,6 @@ export function uploadMedia(file) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(media)
|
|
||||||
|
|
||||||
let body = {}
|
let body = {}
|
||||||
|
|
||||||
if (media.preview) {
|
if (media.preview) {
|
||||||
|
|
|
@ -5,9 +5,9 @@ export function mediaToDatabase(media, removeFlag) {
|
||||||
media.type,
|
media.type,
|
||||||
media.path,
|
media.path,
|
||||||
media.size,
|
media.size,
|
||||||
media.preview.base64,
|
media.preview?.base64 || null,
|
||||||
media.sizes.small.avif.path.replace(/_small\.avif$/, ''),
|
media.sizes?.small?.avif?.path?.replace(/_small\.avif$/, '') || null,
|
||||||
JSON.stringify(media.sizes),
|
JSON.stringify(media.sizes || {}),
|
||||||
removeFlag ? 1 : 0,
|
removeFlag ? 1 : 0,
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue