mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
format date string as yyyy-mm-dd (#288)
This commit is contained in:
parent
c15efe6aad
commit
4ca7c89622
1 changed files with 4 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import { generateUploadSignedUrl, uploadToSignedUrl } from '../../utils/uploads'
|
|||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { env } from '../../env'
|
||||
import { Page } from '../../elastic/types'
|
||||
import { DateTime } from 'luxon'
|
||||
|
||||
export function pageServiceRouter() {
|
||||
const router = express.Router()
|
||||
|
|
@ -37,9 +38,9 @@ export function pageServiceRouter() {
|
|||
const contentType = 'application/json'
|
||||
const bucketName = env.fileUpload.gcsUploadPrivateBucket
|
||||
const uploadUrl = await generateUploadSignedUrl(
|
||||
`${req.params.folder}/${
|
||||
data.userId
|
||||
}/${new Date().toDateString()}/${uuidv4()}.json`,
|
||||
`${req.params.folder}/${data.userId}/${DateTime.now().toFormat(
|
||||
'yyyy-LL-dd'
|
||||
)}/${uuidv4()}.json`,
|
||||
contentType,
|
||||
bucketName
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue