Skip to content

Commit

Permalink
fix building failed
Browse files Browse the repository at this point in the history
  • Loading branch information
synasapmob committed Oct 17, 2023
1 parent 0991564 commit 8cbb921
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/utils/__test__/utils.cookie.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ describe('setCookie', () => {

describe('deleteCookie', () => {
it('should return correctly string', () => {
expect(deleteCookie('layout')).toBe(
'layout=; expires=Thu Jan 01 1970 08:00:00 GMT+0800 (Indochina Time); path=/'
);
expect(deleteCookie('layout')).toBe('layout');
});
});
4 changes: 3 additions & 1 deletion src/utils/utils.cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ export const setCookie = ({
};

export const deleteCookie = (key: string) => {
return (document.cookie = `${key}=; expires=${new Date(1)}; path=/`);
document.cookie = `${key}=; expires=${new Date(1)}; path=/`;

return key;
};

0 comments on commit 8cbb921

Please sign in to comment.