import request from '@/utils/request'

export function getPlatformList() {
    return request({
        url: 'platform/index',
        method: 'get'
    })
}


export function getCategoryList(params) {
    return request({
        url: 'category/index',
        method: 'get',
        params: params
    })
}



export function getCategoryShow(id, params) {
    return request({
        url: `category/show/${id}`,
        method: 'get',
        params: params
    })
}



export function getCategoryDelete(id) {
    return request({
        url: `category/delete/${id}`,
        method: 'DELETE'
    })
}



export function getCategoryAdd(data) {
    console.log(data ,'data')
    return request({
        url: `category/create`,
        method: 'POST',
        data: {
            name:  data.name,
            source_platform: data.source_platform
        }
    })
}



export function getCategoryUpdate( data ,id ) {
    console.log(data ,'getCategoryUpdate')

    return request({
        url: `category/update/${id}`,
        method: 'PUT',
        data: data
    })
}
