Restricted to itemFk
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
ccc5b95b48
commit
ee19ea2993
|
@ -7,7 +7,7 @@ module.exports = Self => {
|
|||
description: 'Returns last entries',
|
||||
accessType: 'WRITE',
|
||||
returns: {
|
||||
type: 'Boolean',
|
||||
type: ['Object'],
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
|
@ -21,7 +21,9 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
const imageQueue = await Self.find({
|
||||
limit: 2
|
||||
where: {
|
||||
itemFk: 410421
|
||||
}
|
||||
});
|
||||
|
||||
// const rootPath = 'C:\\Users\\jsanc\\Desktop\\images';
|
||||
|
@ -32,7 +34,7 @@ module.exports = Self => {
|
|||
await fs.mkdir(tempPath);
|
||||
|
||||
for (let image of imageQueue) {
|
||||
const fileName = `${image.itemFk}.jpg`;
|
||||
const fileName = `${image.itemFk}.png`;
|
||||
const filePath = path.join(tempPath, fileName);
|
||||
|
||||
https.get(image.url, async response => {
|
||||
|
@ -49,6 +51,6 @@ module.exports = Self => {
|
|||
throw e;
|
||||
}
|
||||
|
||||
return true;
|
||||
return imageQueue;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue