Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: url 변경(미완성 #48

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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