@lynsoluciones/medusa-docs
Version:
Medusa plugins to generate docs
46 lines (45 loc) • 1.31 kB
JavaScript
;
/*
*
*
* MIT License
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.POST = void 0;
const POST = async (req, res) => {
const body = req.body;
const invoiceService = req.scope.resolve('invoiceService');
const address = body.address;
try {
if (address !== undefined) {
const newSettings = await invoiceService.updateStoreDocumentAddress(address);
if (newSettings !== undefined) {
res.status(201).json({
settings: newSettings
});
}
else {
res.status(400).json({
message: 'Cant update address'
});
}
}
else {
res.status(400).json({
message: 'Address not passed'
});
}
}
catch (e) {
res.status(400).json({
message: e.message
});
}
};
exports.POST = POST;