mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 22:12:53 +00:00
fix: pipeline
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {HttpClient, PluginClient} from '@openstapps/api';
|
||||
import {Converter} from '@openstapps/core-tools';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
|
||||
@@ -32,13 +32,7 @@ export class MinimalPlugin extends Plugin {
|
||||
* @param numbers the list of numbers
|
||||
*/
|
||||
private static sum(numbers: number[]): number {
|
||||
let out = 0;
|
||||
|
||||
for (const num of numbers) {
|
||||
out += num;
|
||||
}
|
||||
|
||||
return out;
|
||||
return numbers.reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,13 +41,13 @@ export class MinimalPlugin extends Plugin {
|
||||
* For this example the whole purpose of the plugin is to receive a list of numbers and return the sum of them.
|
||||
* TODO: remove the body of the function and replace with your own logic
|
||||
*
|
||||
* @param req the express request object
|
||||
* @param res the express response object
|
||||
* @param request the express request object
|
||||
* @param response the express response object
|
||||
*/
|
||||
// tslint:disable-next-line:prefer-function-over-method
|
||||
protected async onRouteInvoke(req: express.Request, res: express.Response): Promise<void> {
|
||||
protected async onRouteInvoke(request: express.Request, response: express.Response): Promise<void> {
|
||||
// get the body from the request as a SCMinimalRequest for static type-safety
|
||||
const requestBody = req.body as SCMinimalRequest;
|
||||
const requestBody = request.body as SCMinimalRequest;
|
||||
|
||||
// create out response body
|
||||
const responseBody: SCMinimalResponse = {
|
||||
@@ -61,6 +55,6 @@ export class MinimalPlugin extends Plugin {
|
||||
};
|
||||
|
||||
// send the response
|
||||
res.json(responseBody);
|
||||
response.json(responseBody);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user