8d66430c2a
refs TryGhost/Ghost#8455 - ensure `uploadUrls` and `errors` are cleared in `gh-uploader` when new uploads are started - yield `isUploading` in `gh-uploader` component - replace image upload modals in settings/general with in-page uploads
18 lines
533 B
JavaScript
18 lines
533 B
JavaScript
const fileUploadResponse = function (db, {requestBody}) {
|
|
let [file] = requestBody.getAll('uploadimage');
|
|
let now = new Date();
|
|
let year = now.getFullYear();
|
|
let month = `${now.getMonth()}`;
|
|
|
|
if (month.length === 1) {
|
|
month = `0${month}`;
|
|
}
|
|
|
|
return `"/content/images/${year}/${month}/${file.name}"`;
|
|
};
|
|
|
|
export default function mockUploads(server) {
|
|
server.post('/uploads/', fileUploadResponse, 200, {timing: 100});
|
|
server.post('/uploads/icon/', fileUploadResponse, 200, {timing: 100});
|
|
}
|