mirror of
https://github.com/wekan/wekan.git
synced 2025-12-22 10:20:14 +01:00
Add REST API endpoint to retrieve a card by ID
This commit is contained in:
parent
56700d1d06
commit
fc77d0d201
2 changed files with 44 additions and 0 deletions
|
|
@ -3301,6 +3301,27 @@ if (Meteor.isServer) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @operation get_card_by_id
|
||||||
|
* @summary Get a Card by Card ID
|
||||||
|
*
|
||||||
|
* @param {string} cardId the card ID
|
||||||
|
* @return_type Cards
|
||||||
|
*/
|
||||||
|
JsonRoutes.add(
|
||||||
|
'GET',
|
||||||
|
'/api/cards/:cardId',
|
||||||
|
function(req, res) {
|
||||||
|
const paramCardId = req.params.cardId;
|
||||||
|
card = ReactiveCache.getCard(paramCardId)
|
||||||
|
Authentication.checkBoardAccess(req.userId, card.boardId);
|
||||||
|
JsonRoutes.sendResult(res, {
|
||||||
|
code: 200,
|
||||||
|
data: ReactiveCache.getCard(paramCardId),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @operation get_card
|
* @operation get_card
|
||||||
* @summary Get a Card
|
* @summary Get a Card
|
||||||
|
|
|
||||||
|
|
@ -2612,6 +2612,29 @@ paths:
|
||||||
type: integer
|
type: integer
|
||||||
public:
|
public:
|
||||||
type: integer
|
type: integer
|
||||||
|
/api/cards/{card}:
|
||||||
|
get:
|
||||||
|
operationId: get_card_by_id
|
||||||
|
summary: Get a Card by Card ID
|
||||||
|
tags:
|
||||||
|
- Cards
|
||||||
|
parameters:
|
||||||
|
- name: card
|
||||||
|
in: path
|
||||||
|
description: |
|
||||||
|
the card ID
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
security:
|
||||||
|
- UserSecurity: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: |-
|
||||||
|
200 response
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/Cards"
|
||||||
/api/users/{user}/boards:
|
/api/users/{user}/boards:
|
||||||
get:
|
get:
|
||||||
operationId: get_boards_from_user
|
operationId: get_boards_from_user
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue