@lynsoluciones/medusa-docs
Version:
Medusa plugins to generate docs
32 lines (31 loc) • 974 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 invoiceService = req.scope.resolve('invoiceService');
const formatNumber = req.query.formatNumber;
const forcedNumber = req.query.forcedNumber;
try {
const nextDisplayNumber = await invoiceService.getTestDisplayNumber(formatNumber, forcedNumber);
res.status(201).json({
displayNumber: nextDisplayNumber
});
}
catch (e) {
res.status(400).json({
message: e.message
});
}
};
exports.GET = GET;