UNPKG

mercadopago

Version:
24 lines (23 loc) 887 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = update; const path_1 = require("../../../utils/path"); /** * Implementation of the "update subscription plan" operation. * * Sends a PUT to `/preapproval_plan/{id}` with the modified fields * and returns the updated plan resource. * * @module clients/preApprovalPlan/update */ const restClient_1 = require("../../../utils/restClient"); /** * Update an existing subscription plan template. * * @returns The updated plan resource. */ function update({ id, updatePreApprovalPlanRequest, config }) { return restClient_1.RestClient.fetch(`/preapproval_plan/${(0, path_1.encodePathParam)(id)}`, Object.assign({ method: 'PUT', headers: { 'Authorization': `Bearer ${config.accessToken}`, }, body: JSON.stringify(updatePreApprovalPlanRequest) }, config.options)); }