mirror of
https://github.com/plankanban/planka.git
synced 2025-12-23 17:25:16 +03:00
fix: Optimize query methods
This commit is contained in:
@@ -3,12 +3,16 @@
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
const { makeRowToModelTransformer } = require('../helpers');
|
||||
|
||||
const COLUMN_NAME_BY_TYPE = {
|
||||
[UploadedFile.Types.USER_AVATAR]: 'user_avatars',
|
||||
[UploadedFile.Types.BACKGROUND_IMAGE]: 'background_images',
|
||||
[UploadedFile.Types.ATTACHMENT]: 'attachments',
|
||||
};
|
||||
|
||||
const transformRowToModel = makeRowToModelTransformer(UploadedFile);
|
||||
|
||||
/* Query methods */
|
||||
|
||||
const createOne = (values) =>
|
||||
@@ -47,4 +51,6 @@ const deleteOne = (criteria) =>
|
||||
module.exports = {
|
||||
createOne,
|
||||
deleteOne,
|
||||
|
||||
transformRowToModel,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user