@jrmc/adonis-attachment
Version:
Turn any field on your Lucid model to an attachment data type
30 lines (29 loc) • 884 B
JavaScript
import RecordWithAttachment from '../src/services/record_with_attachment.js';
export default class RegenerateService {
model(Model, options = {}) {
this.
this.
return this;
}
row(row, options = {}) {
this.
this.
return this;
}
async run() {
if (this.
const record = new RecordWithAttachment(this.
return record.regenerateVariants(this.
}
else if (this.
const entities = await this.
return Promise.all(entities.map(async (entity) => {
const record = new RecordWithAttachment(entity);
return record.regenerateVariants(this.
}));
}
}
}