|
|
@ -1,5 +1,5 @@ |
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
import catchError from '../../helpers/catchError'; |
|
|
|
import catchError, { NcError } from '../../helpers/catchError'; |
|
|
|
import { Router } from 'express'; |
|
|
|
import { Router } from 'express'; |
|
|
|
import Model from '../../../../noco-models/Model'; |
|
|
|
import Model from '../../../../noco-models/Model'; |
|
|
|
import getSwaggerJSON from './helpers/getSwaggerJSON'; |
|
|
|
import getSwaggerJSON from './helpers/getSwaggerJSON'; |
|
|
@ -9,6 +9,9 @@ import redocHtml from './redocHtml'; |
|
|
|
|
|
|
|
|
|
|
|
async function swaggerJson(req, res) { |
|
|
|
async function swaggerJson(req, res) { |
|
|
|
const project = await Project.get(req.params.projectId); |
|
|
|
const project = await Project.get(req.params.projectId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!project) NcError.notFound(); |
|
|
|
|
|
|
|
|
|
|
|
const models = await Model.list({ |
|
|
|
const models = await Model.list({ |
|
|
|
project_id: req.params.project_id, |
|
|
|
project_id: req.params.project_id, |
|
|
|
base_id: null |
|
|
|
base_id: null |
|
|
|