Skip to content

Commit

Permalink
Merge pull request #48 from ananjaemin/46-url-개편
Browse files Browse the repository at this point in the history
feat: url 변경(미완성
  • Loading branch information
ananjaemin committed Nov 10, 2022
2 parents 57f4308 + 64afb14 commit 1f2839e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pages/download/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const DownloadPage: React.FC = () => {
</FileBox>
<S.DownloadPageButtonSection>
<a
href={`${process.env.REACT_APP_BACKEND_BASEURL}/dl/${downloadFileProps.filename}${
href={`${downloadFileProps.download_url}${
downloadFileProps.token != null ? `?${downloadFileProps.token}` : ''
}`}
>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ export const MainPage: React.FC = () => {
const [typingCount, setTypingCount] = useState(0);
const [uploading, setUploading] = useState(true);
const [progressValue, serProgressValue] = useState(0);
// eslint-disable-next-line

const [retentionPeriod, setRetentionPeriod] = useState(false);
// eslint-disable-next-line
const [downloadCount, setDownloadCount] = useState(false);
// eslint-disable-next-line
const [passwordBoolean, setPasswordBoolean] = useState(false);

const [password, setPassword] = useState('');
const [fileProps, setFileProps] = useState({
filename: '',
Expand Down Expand Up @@ -75,6 +74,7 @@ export const MainPage: React.FC = () => {
size: getFileSize(res.data.size),
lastModified: res.data.lastModified,
token: res.data.token,
download_url: res.data.download_url,
//추후에 기한,다운로드횟수 추가예정
});
} else {
Expand Down
5 changes: 4 additions & 1 deletion src/state/reducers/DeleteFileProps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { ActionType } from '../action-types';
import { Action } from '../actions';

const reducer = (state: any = { filename: null, token: null }, action: Action): any => {
const reducer = (
state: any = { filename: null, token: null, delete_url: null },
action: Action,
): any => {
switch (action.type) {
case ActionType.DeleteFileProps:
return action.props;
Expand Down
2 changes: 1 addition & 1 deletion src/state/reducers/DownloadFileProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ActionType } from '../action-types';
import { Action } from '../actions';

const reducer = (
state: any = { filename: null, size: null, lastModified: null, token: null },
state: any = { filename: null, size: null, lastModified: null, token: null, donwload_url: null },
action: Action,
): any => {
switch (action.type) {
Expand Down

0 comments on commit 1f2839e

Please sign in to comment.