How to use the @choerodon/master.axios.post function in @choerodon/master

To help you get started, we’ve selected a few @choerodon/master examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github choerodon / devops-service / react / routes / app-service / app-list / modal / CreateForm.js View on Github external
async function selectFile(e) {
    const formdata = new FormData();
    const img = e.target.files[0];
    formdata.append('file', e.target.files[0]);
    try {
      const data = await axios.post(
        `/file/v1/files?bucket_name=devops-service&file_name=${img.name.split('.')[0]}`,
        formdata,
        {
          header: { 'Content-Type': 'multipart/form-data' },
        },
      );
      if (data) {
        record.set('imgUrl', data);
        getBase64(formdata.get('file'), (imgUrl) => {
          const ele = document.getElementById('img');
          ele.style.backgroundImage = `url(${imgUrl})`;
          setImgback(imgUrl);
        });
      }
    } catch (err) {
      // asfd
github choerodon / devops-service / react / routes / environment / main-view / contents / detail / modals / resource-setting / store / NotificationsStore.js View on Github external
async loadListData({ projectId, page, size, sort, param, env }) {
    this.setLoading(true);

    const envParam = env ? `env_id=${env}&` : '';

    const sortPath = sort
      ? `&sort=${sort.field || sort.columnKey},${SORTER_MAP[sort.order] || 'desc'}`
      : '';

    const url = `/devops/v1/projects/${projectId}/notification/page_by_options?${envParam}page=${page}&size=${size}${sortPath}`;

    const data = await axios
      .post(url, JSON.stringify(param))
      .catch((e) => {
        this.setLoading(false);
        Choerodon.handleResponseError(e);
      });

    if (handlePromptError(data)) {
      const { pageNum, total, pageSize, list } = data;

      const pageInfo = {
        current: pageNum,
        total,
        pageSize,
      };
      this.setListData(list);
      this.setPageInfo(pageInfo);
github choerodon / devops-service / react / routes / environment / main-view / contents / detail / modals / resource-setting / store / NotificationsStore.js View on Github external
  createData = (projectId, data) => axios.post(`/devops/v1/projects/${projectId}/notification`, JSON.stringify(data));
github choerodon / devops-service / react / routes / resource / main-view / stores / useCustomStore.js View on Github external
createData(projectId, data) {
      if (data.get('resourceId')) {
        return axios.put(`/devops/v1/projects/${projectId}/customize_resource`,
          data, { headers: { 'Content-Type': 'multipart/form-data' } });  
      } else {
        return axios.post(`/devops/v1/projects/${projectId}/customize_resource`,
          data, { headers: { 'Content-Type': 'multipart/form-data' } });
      }
    },
  }));
github choerodon / devops-service / react / routes / resource / main-view / contents / application / stores / useSecretStore.js View on Github external
postKV(projectId, data) {
      const { id } = data;
      if (id) {
        return axios.put(`/devops/v1/projects/${projectId}/secret`, JSON.stringify(data));
      } else {
        return axios.post(`/devops/v1/projects/${projectId}/secret`, JSON.stringify(data));
      }
    },
github choerodon / devops-service / react / routes / environment / main-view / sidebar / tree-item / stores / useStore.js View on Github external
checkEffect(projectId, id) {
      return axios.post(`/devops/v1/projects/${projectId}/app_service_instances/list_running_instance?env_id=${id}&page=1&size=10`, JSON.stringify({ params: [], searchParam: {} }));
    },

@choerodon/master

A package of Master for Choerodon platform.

ISC
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis