Merge pull request 'Update' (#104) from that-fe into master
Reviewed-on: #104
This commit is contained in:
commit
5165ded25e
|
|
@ -55,8 +55,6 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
max-height: 72vh;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.titleSidebar {
|
.titleSidebar {
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,9 @@ const StaffEvaluation = () => {
|
||||||
name: '',
|
name: '',
|
||||||
role: '',
|
role: '',
|
||||||
note: '',
|
note: '',
|
||||||
|
user_id: 0,
|
||||||
|
created_at: '',
|
||||||
|
updated_at: '',
|
||||||
},
|
},
|
||||||
validate: {
|
validate: {
|
||||||
name: (value) =>
|
name: (value) =>
|
||||||
|
|
@ -511,9 +514,10 @@ const StaffEvaluation = () => {
|
||||||
|
|
||||||
const handleCreate = async (values: DataProjectReview) => {
|
const handleCreate = async (values: DataProjectReview) => {
|
||||||
try {
|
try {
|
||||||
const { id, ...data } = values
|
|
||||||
const res = await post(projectReviewAdd, {
|
const res = await post(projectReviewAdd, {
|
||||||
...data,
|
name: values.name,
|
||||||
|
role: values.role,
|
||||||
|
note: values.note,
|
||||||
user_id: filter.userID,
|
user_id: filter.userID,
|
||||||
})
|
})
|
||||||
if (res.id) {
|
if (res.id) {
|
||||||
|
|
@ -530,7 +534,10 @@ const StaffEvaluation = () => {
|
||||||
const handleUpdate = async (values: DataProjectReview) => {
|
const handleUpdate = async (values: DataProjectReview) => {
|
||||||
try {
|
try {
|
||||||
const res = await update(projectReviewUpdate, {
|
const res = await update(projectReviewUpdate, {
|
||||||
...values,
|
id: values.id,
|
||||||
|
name: values.name,
|
||||||
|
role: values.role,
|
||||||
|
note: values.note,
|
||||||
user_id: filter.userID,
|
user_id: filter.userID,
|
||||||
})
|
})
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { getFormDataHeader, getHeaderInfo } from '@/rtk/helpers/tokenCreator'
|
||||||
import { removeTokens } from '@/rtk/localStorage'
|
import { removeTokens } from '@/rtk/localStorage'
|
||||||
import { notifications } from '@mantine/notifications'
|
import { notifications } from '@mantine/notifications'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import moment from 'moment'
|
|
||||||
const handleResponse = (response: any) => {
|
const handleResponse = (response: any) => {
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
removeTokens()
|
removeTokens()
|
||||||
|
|
@ -158,14 +157,18 @@ export const postImage = async (url: string, body: any, method: any) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const exportFile = async (url: string, params: any = {}, fileName: string) => {
|
export const exportFile = async (
|
||||||
|
url: string,
|
||||||
|
params: any = {},
|
||||||
|
fileName: string,
|
||||||
|
) => {
|
||||||
const header = await getHeaderInfo()
|
const header = await getHeaderInfo()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(url, {
|
const response = await axios.get(url, {
|
||||||
...header,
|
...header,
|
||||||
params,
|
params,
|
||||||
responseType: 'blob'
|
responseType: 'blob',
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue