Browse Source

fix: update count api

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/1620/head
mertmit 3 years ago
parent
commit
d82758f194
  1. 4
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts
  2. 69
      scripts/sdk/swagger.json

4
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

@ -14,7 +14,7 @@ async function dataList(req: Request, res: Response) {
}
async function dataCount(req: Request, res: Response) {
const { model, view } = await getViewAndModelFromRequest(req);
const { model, view } = await getViewAndModelFromRequestByAliasOrId(req);
const base = await Base.get(model.base_id);
@ -158,7 +158,7 @@ router.get(
ncMetaAclMw(dataList, 'dataList')
);
router.get(
'/data/:orgs/:projectName/:tableName/views/:viewName/count',
'/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName/count',
ncMetaAclMw(dataCount, 'dataCount')
);

69
scripts/sdk/swagger.json

@ -2482,6 +2482,75 @@
}
}
},
"/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/count": {
"parameters": [
{
"schema": {
"type": "string"
},
"name": "orgs",
"in": "path",
"required": true
},
{
"schema": {
"type": "string"
},
"name": "projectName",
"in": "path",
"required": true
},
{
"schema": {
"type": "string"
},
"name": "tableName",
"in": "path",
"required": true
},
{
"schema": {
"type": "string"
},
"name": "viewName",
"in": "path",
"required": true
}
],
"get": {
"summary": "",
"operationId": "db-view-row-count",
"description": "",
"tags": [
"DB View Row"
],
"parameters": [
{
"schema": {
"type": "string"
},
"in": "query",
"name": "where"
},
{
"schema": {},
"in": "query",
"name": "nested",
"description": "Query params for nested data"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId}": {
"parameters": [
{

Loading…
Cancel
Save