Skip to content

NewsType API

atsanan edited this page Oct 18, 2018 · 8 revisions

13. NewsType

[x] 13.1 Get NewsType

GET /api/v1/newsType?page=0&limit=0

Query parameters:

Field Description Optional Default
page Current index of page Yes 0
limit Maximum of page Yes 10
Returns:
{
    "data": {
        "newsTypes": [
            {
                "_id": "5b8dd237aaea3c3fa4560211",
                "created_at": "2018-09-04T00:30:47.736Z",
                "newsTypeDetail": {
                    "chi1": "newsTypeDetailChi1",
                    "chi2": "newsTypeDetailChi2",
                    "eng": "newsTypeDetailEng",
                    "thai": "newsTypeDetailThai"
                },
                "newsTypeName": {
                    "chi1": "newsTypeName",
                    "chi12": "newsTypeName",
                    "eng": "newsTypeName",
                    "thai": "newsTypeName"
                },
                "order": 1,
                "updated_at": "2018-09-05T03:27:59.528Z"
            },
            {
                "_id": "5bc04bdd5ae5873eb0007649",
                "created_at": "2018-10-12T07:23:09Z",
                "newsTypeDetail": {
                    "chi1": "chi1",
                    "chi2": "chi2",
                    "eng": "eng",
                    "thai": "tha"
                },
                "newsTypeName": {
                    "chi1": "chi1",
                    "chi2": "chi2",
                    "eng": "eng",
                    "thai": "thai"
                },
                "order": 1000,
                "updated_at": "2018-10-12T07:23:09Z"
            }
        ],
        "pageIndex": 0,
        "pageLimit": 10,
        "pages": 1,
        "paging": {
            "next": "",
            "previous": ""
        }
    },
    "isSuccess": true
}

[x] 13.2 Add NewsType

POST /api/v1/newsType

Query parameters:

Field Description Optional Default
newsTypeName Name of NewsType No
newsTypeDetails Details of NewsType No
order order No
Returns:
{
    "data": {
        "_id": "5b8e88ed784d600001faf924",
        "created_at": "2018-09-04T13:30:21.041Z",
        "updated_at": "2018-09-04T13:30:21.041Z",
        "newsTypeDetail": {
                    "chi1": "newsTypeDetailChi1",
                    "chi2": "newsTypeDetailChi2",
                    "eng": "newsTypeDetailEng",
                    "thai": "newsTypeDetailThai"
                },
       "newsTypeName": {
                    "chi1": "newsTypeName",
                    "chi12": "newsTypeName",
                    "eng": "newsTypeName",
                    "thai": "newsTypeName"
                },
       "order":1
    },
    "isSuccess": true
}

[x] 13.3 Update NewsType

POST /api/v1/newsType/{id:srting}

Query parameters:

Field Description Optional Default
newsTypeName Name of NewsType No
newsTypeDetails Details of NewsType No
order order No
Returns:
{
    "data": {
        "_id": "5b8e88ed784d600001faf924",
        "created_at": "2018-09-04T13:30:21.041Z",
        "updated_at": "2018-09-04T13:30:21.041Z",
        "newsTypeDetail": {
                    "chi1": "newsTypeDetailChi1",
                    "chi2": "newsTypeDetailChi2",
                    "eng": "newsTypeDetailEng",
                    "thai": "newsTypeDetailThai"
                },
       "newsTypeName": {
                    "chi1": "newsTypeName",
                    "chi12": "newsTypeName",
                    "eng": "newsTypeName",
                    "thai": "newsTypeName"
                },
       "order":1
    },
    "isSuccess": true
}

Clone this wiki locally