@lynsoluciones/medusa-docs
Version:
Medusa plugins to generate docs
29 lines (28 loc) • 883 B
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.GET = void 0;
const GET = async (req, res) => {
const packingSlipService = req.scope.resolve('packingSlipService');
try {
const chosenTemplate = req.query.template;
const packingSlipResult = await packingSlipService.generatePreview(chosenTemplate);
res.status(201).json(packingSlipResult);
}
catch (e) {
res.status(400).json({
message: e.message
});
}
};
exports.GET = GET;