Skip to content

Commit

Permalink
Merge pull request #98 from joog-lim/develop
Browse files Browse the repository at this point in the history
Hotfix: display wrong algoirthmNumber
  • Loading branch information
sunrabbit123 authored Apr 12, 2022
2 parents e7b51ea + 681e958 commit 75a34aa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/algorithms/algorithms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const Algorithms: React.FC<algorithmsProps> = (p: algorithmsProps) => {

const [emojiCnt, setEmojiCnt] = useState<number>(0);
const [isEmojiClick, setEmojiClick] = useState<boolean>(false);
const number = p.data.idx;

const { algorithmNumber, idx } = p.data;
const addEmoji = () => {
emojiController
.addEmoji(isLogin, number)
.addEmoji(isLogin, idx)
.then((res: AxiosResponse<emojiRes> | void) => {
if (res?.status === 200) {
window.localStorage.setItem(String(number), "true");
window.localStorage.setItem(String(idx), "true");
} else {
setEmojiClick(false);
setEmojiCnt(emojiCnt);
Expand All @@ -32,10 +32,10 @@ const Algorithms: React.FC<algorithmsProps> = (p: algorithmsProps) => {

const deleteEmoji = () => {
emojiController
.deleteEmoji(isLogin, number)
.deleteEmoji(isLogin, idx)
.then((res: AxiosResponse<emojiRes> | void) => {
if (res?.status === 200) {
window.localStorage.setItem(String(number), "false");
window.localStorage.setItem(String(idx), "false");
} else {
setEmojiClick(true);
setEmojiCnt(emojiCnt);
Expand All @@ -57,10 +57,10 @@ const Algorithms: React.FC<algorithmsProps> = (p: algorithmsProps) => {
return (
<article className={style.algorithmsBox}>
<Header
id={String(p.data.idx)}
id={String(idx)}
status={AlgorithmFilter}
createdAt={p.data.createdAt}
number={number}
number={algorithmNumber}
tag={p.data.tag}
content={p.data.content}
title={p.data.title}
Expand Down

0 comments on commit 75a34aa

Please sign in to comment.