0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Added custom formatter to uploads limit

refs https://linear.app/tryghost/issue/CORE-121/create-a-video-storage-adapter

 - Provides readable bytes -> megabytes conversion for filesize limit
This commit is contained in:
Naz 2021-10-26 15:49:59 +04:00
parent 4172f993d4
commit f6fbfe712a

View file

@ -50,6 +50,9 @@ module.exports = {
// NOTE: this function should not ever be used as for uploads we compare the size
// of the uploaded file with the configured limit. Noop is here to keep the
// MaxLimit constructor happy
currentCountQuery: () => {}
currentCountQuery: () => {},
// NOTE: the uploads limit is based on file sizes provided in Bytes
// a custom formatter is here for more user-friendly formatting when forming an error
formatter: count => `${count / 1000000}MB`
}
};