# Module Action
# Add Module Action
Sử dụng API này để thêm bản ghi mới
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
companyId | Number | get in token payload | ✔️ |
name | String | ✔️ | |
code | String | ✔️ | |
description | String | ✔️ | |
createdBy | Number | get in token payload | ✔️ |
updatedBy | Number | get in token payload | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [
{
...<data>
}
],
"$rltUpdate": [],
"$rltRemove": [],
"$rltDelete": []
}
}
curl -X POST http://localhost:3000/moduleAction/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$add": [
{
"name": "name",
"code": "code",
"description": "description"
}
]
}
}'
# Update Module Action
Sử dụng API này để cập nhật nội dung
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
id | Number | ✔️ | |
companyId | Number | get in token payload | ✔️ |
name | String | ✔️ | |
code | String | ✔️ | |
description | String | ✔️ | |
updatedBy | Number | get in token payload | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [],
"$rltUpdate": [
{
...<data>
}
],
"$rltRemove": [],
"$rltDelete": []
}
}
curl -X POST http://localhost:3000/moduleAction/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$update": [
{
"id": 1,
"name": "name",
"code": "code",
"description": "description"
}
]
}
}'
# Delete Permissions
Sử dụng API này để xóa bản ghi trên giao diện
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
id | Number | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [],
"$rltUpdate": [],
"$rltRemove": [],
"$rltDelete": [
{
...<data>
}
]
}
}
curl -X POST http://localhost:3000/moduleAction/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$delete": [
{
"id": 1
}
]
}
}'
# Remove Permissions
Sử dụng API này để xóa bản ghi khỏi database
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
id | Number | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [],
"$rltUpdate": [],
"$rltRemove": [
{
...<data>
}
],
"$rltDelete": []
}
}
curl -X POST http://localhost:3000/moduleAction/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$remove": [
{
"id": 1
}
]
}
}'
# Get List Permissions
Sử dụng API này để lấy danh sách Permissions
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
companyId | Number | get in token payload | ✔️ |
name | String | ➖ |
# Response
{
"status": true,
"message": "success",
"totalRows": 30,
"rows": [
{
"id": 29,
"name": "export-pdf",
"code": "export-pdf",
"description": "",
"deleted": false,
"createdBy": 1,
"updatedBy": 1,
"createdAt": "2021-09-14T12:07:38.000Z",
"updatedAt": "2021-09-14T12:07:38.000Z"
},
{
...<data>
}
]
}
curl -X POST http://localhost:3000/moduleAction/getListPaging \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"name": "name"
}'