Skip to content

Commit

Permalink
Merge pull request #14 from pieceowater-dev/dev
Browse files Browse the repository at this point in the history
fix: lil
  • Loading branch information
baynt1 authored May 29, 2024
2 parents 7a75414 + e9d3787 commit 7132c53
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Grands-Pay</title>
<title>Grand S - Pay</title>
</head>
<body>
<div id="root"></div>
Expand Down
1 change: 1 addition & 0 deletions src/entities/settings/posts-table/model/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export interface IPostsResponse {
name: string
address: string
identifier: string
stopped?: boolean
}
14 changes: 12 additions & 2 deletions src/entities/settings/posts-table/use-posts-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const usePostsTable = () => {
const [currentPost, setCurrentPost] = useState<(IPostsResponse & { id: number }) | undefined>(
undefined,
)
const [stoppedPosts, setStoppedPosts] = useState<{ id: number; stopped: boolean }[]>([])

const fetchData = async (skip?: number) => {
try {
Expand All @@ -35,7 +36,12 @@ export const usePostsTable = () => {
label: item.name,
}))
dispatch(setPostsState(select))

setStoppedPosts(
res.data.items.map((item: IPostsResponse) => ({
id: item.id,
stopped: item.stopped,
})),
)
setPosts(response)
setTotalPosts(res.data.totals.count || 0)
} catch (error) {
Expand Down Expand Up @@ -100,7 +106,11 @@ export const usePostsTable = () => {
Редактировать
</a>
<a onClick={() => (stopLoading ? null : deletePost(record.key, true))}>
{stopLoading ? 'Загрузка' : 'Приостановить'}
{stopLoading
? 'Загрузка'
: stoppedPosts.filter((item) => item.id === record.key)[0].stopped
? 'Приостановлен'
: 'Приостановить'}
</a>
<a onClick={() => (deleteLoading ? null : deletePost(record.key))}>
{deleteLoading ? 'Загрузка' : 'Удалить'}
Expand Down
2 changes: 1 addition & 1 deletion src/features/settings/new-post/new-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const NewPost: FC<INewPostProps> = ({ open, handeOpen, item, refetch }) =
res.data.map((item: IUsersForPostsResponse) => {
return {
label: item.user.name,
value: item.user.id,
value: item.id,
}
}),
)
Expand Down
2 changes: 1 addition & 1 deletion src/features/settings/new-user/new-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const NewUser: FC<INewUserProps> = ({ open, handleModal, item, refetch })
res.data.map((item: IPostsForUsersResponse) => {
return {
label: item.post.name,
value: item.post.id,
value: item.id,
}
}),
)
Expand Down
2 changes: 1 addition & 1 deletion src/widget/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Header: FC = () => {
onClick={() => navigator('/')}
>
<img src={'/logo.png'} style={{ width: '30px' }} alt={'logo'} />
Grands-Pay
Grand S - Pay
</div>

<Flex gap={'15px'}>
Expand Down

0 comments on commit 7132c53

Please sign in to comment.