Parcourir la source

fix: error on create and del department

dev
powersir il y a 11 mois
Parent
révision
65f6e5556c
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. +3
    -3
      src/pages/system/dept/create-department.tsx
  2. +1
    -1
      src/pages/system/dept/index.tsx

+ 3
- 3
src/pages/system/dept/create-department.tsx Voir le fichier

@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import { Form, Input, InputNumber, Radio, Modal, Switch } from 'antd';
import positonService from '@/request/service/positon';
import departmentService from '@/request/service/deparatment';
import { useRequest } from '@/hooks/use-request';
import type { DepartmentVO } from '@/models'
import { antdUtils } from '@/utils/antd';
@@ -22,8 +22,8 @@ const DepartmentEditor: React.FC<EditorProps> = (props) => {

const { visible, onCancel, onSave, data } = props;

const { runAsync: updatePostApi } = useRequest(positonService.updatePostApi, { manual: true });
const { runAsync: createPostApi } = useRequest(positonService.createPostApi, { manual: true });
const { runAsync: updatePostApi } = useRequest(departmentService.updateDeptApi, { manual: true });
const { runAsync: createPostApi } = useRequest(departmentService.createDeptApi, { manual: true });

const isEdit = !!data;



+ 1
- 1
src/pages/system/dept/index.tsx Voir le fichier

@@ -39,7 +39,7 @@ export default () => {
cancelText: '取消',
onOk() {
return new Promise(async (resolve) => {
const [error, { code, msg }] = await deleteApi({ id: data.id });
const [error, { code, msg }] = await deleteApi(data.id);
if (error || code !== 0) {
antdUtils.message?.open({ type: 'error', content: msg ?? '操作失败' })
} else {


Chargement…
Annuler
Enregistrer