12 lines
365 B
JavaScript
12 lines
365 B
JavaScript
const { getRRConfigForBodyshop } = require("./rr-config");
|
|
const { makeRRClient } = require("./rr-client");
|
|
const logger = require("../utils/logger");
|
|
|
|
async function withClient(bodyshopId, fn) {
|
|
const routing = await getRRConfigForBodyshop(bodyshopId);
|
|
const client = makeRRClient({ logger });
|
|
return fn(client, routing);
|
|
}
|
|
|
|
module.exports = { withClient };
|