
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@fickou/adonis-controller-helpers
Advanced tools
Add helper on Controller for Adonis JS 5+
Run:
npm i --save @fickou/adonis-controller-helpers
Install provider:
node ace configure @fickou/adonis-controller-helpers
In a controller
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
import IndexService from 'App/Services/users/Index'
import Database from "@ioc:Adonis/Lucid/Database";
export default UserController{
public index({ request, response }: HttpContextContract){
let data = await request.checkInputs();
await Database.transaction(async (trx) => {
const executor = new Index(trx);
return response.apiView(await executor.execute(data));
});
}
}
In a service:
import Parameter from 'App/Models/settings/Parameter';
import ControllerHelper, from "@ioc:Adonis/Addons/ControllerHelper";
import {Service} from "@fickou/adonis-controller-helpers";
export default class Index extends Service {
async execute(payload) {
const query = Parameter.query({client: this.trx});
return ControllerHelper.searchPayload(query, payload);
}
}
// or
export default class Index extends Service {
async execute(payload) {
const query = ControllerHelper.buildQuery((this.trx || Database), (db) => db.query()
.from('parameters')
.select(['*']);
return ControllerHelper.searchDatabasePayload(query, payload);
}
}
FAQs
Help dev to filter database with query parameters
The npm package @fickou/adonis-controller-helpers receives a total of 0 weekly downloads. As such, @fickou/adonis-controller-helpers popularity was classified as not popular.
We found that @fickou/adonis-controller-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.