Commit f34edb1bbc641bd9bf53200c079b8a9e010baf21
1 parent
a7904e83
setup cover when the work cloned as tempate
Showing
1 changed file
with
1 additions
and
1 deletions
back-end/h5-api/api/work/controllers/Work.js
| ... | ... | @@ -58,7 +58,7 @@ module.exports = { |
| 58 | 58 | |
| 59 | 59 | // eslint-disable-next-line no-unused-vars |
| 60 | 60 | const templateWork = await strapi.services.work.create(); |
| 61 | - return strapi.services.work.update({id: templateWork.id}, { pages: work.pages, is_template: true }); | |
| 61 | + return strapi.services.work.update({id: templateWork.id}, { pages: work.pages, is_template: true, cover_image_url: work.cover_image_url }); | |
| 62 | 62 | }, |
| 63 | 63 | useTemplate: async (ctx) => { |
| 64 | 64 | let templateWork = await strapi.services.work.findOne(ctx.params); | ... | ... |