1 | const assert = require ('assert');
|
2 | const UploadAction = require ('./upload-action');
|
3 |
|
4 | /**
|
5 | * @class FieldsUploadAction
|
6 | *
|
7 | * Action for accepting a mix of files.
|
8 | */
|
9 | module.exports = UploadAction.extend ({
|
10 | /// The name of the field that will contain the uploaded file.
|
11 | fields: null,
|
12 |
|
13 | init () {
|
14 | this._super.call (this, ...arguments);
|
15 |
|
16 | assert (!!this.fields, "You must define the 'fields' property.");
|
17 |
|
18 | this._middleware = this._upload.fields (this.fields);
|
19 | }
|
20 | });
|