github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/ui/src/api/section.js (about)

     1  import request from '../utils/request'
     2  import api from './manage'
     3  
     4  // section
     5  export function listSection (ownerId, ownerType) {
     6    const data = {'action': 'listSection', id: ownerId, mode: ownerType}
     7  
     8    return request({
     9      url: api.admin,
    10      method: 'post',
    11      data: data
    12    })
    13  }
    14  
    15  export function createSection (ownerId, sectionId, ownerType) {
    16    const data = {'action': 'createSection',
    17        data: { ownerType: ownerType,  ownerId: ''+ownerId, sectionId: ''+sectionId}}
    18  
    19    return request({
    20      url: api.admin,
    21      method: 'post',
    22      data: data
    23    })
    24  }
    25  
    26  export function updateSection (section, ownerType) {
    27    const data = {'action': 'updateSection', data: section, mode: ownerType}
    28  
    29    return request({
    30      url: api.admin,
    31      method: 'post',
    32      data: data
    33    })
    34  }
    35  
    36  export function removeSection (sectionId, ownerType) {
    37    const data = {'action': 'removeSection', id: sectionId, mode: ownerType}
    38  
    39    return request({
    40      url: api.admin,
    41      method: 'post',
    42      data: data
    43    })
    44  }