Skip to content

Commit

Permalink
docs: fix Upload mocky api in demo and test (#44883)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Sep 15, 2023
1 parent 622e432 commit 64b649e
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion components/form/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ describe('Form', () => {
it('form child components should be given priority to own disabled props when it in a disabled form', () => {
const props = {
name: 'file',
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
headers: {
authorization: 'authorization-text',
},
Expand Down
2 changes: 1 addition & 1 deletion components/upload/__tests__/uploadlist.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ describe('Upload List', () => {
<Upload
ref={uploadRef}
fileList={testFileList}
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
multiple
onChange={(info) => {
setTestFileList([...info.fileList]);
Expand Down
4 changes: 2 additions & 2 deletions components/upload/demo/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const App: React.FC = () => {
listType="picture-card"
className="avatar-uploader"
showUploadList={false}
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
beforeUpload={beforeUpload}
onChange={handleChange}
>
Expand All @@ -65,7 +65,7 @@ const App: React.FC = () => {
listType="picture-circle"
className="avatar-uploader"
showUploadList={false}
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
beforeUpload={beforeUpload}
onChange={handleChange}
>
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button, message, Upload } from 'antd';

const props: UploadProps = {
name: 'file',
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
headers: {
authorization: 'authorization-text',
},
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/component-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { UploadProps } from 'antd';
import { Button, ConfigProvider, Upload } from 'antd';

const props: UploadProps = {
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
onChange({ file, fileList }) {
if (file.status !== 'uploading') {
console.log(file, fileList);
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/crop-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const App: React.FC = () => {
return (
<ImgCrop rotationSlider>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture-card"
fileList={fileList}
onChange={onChange}
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/customize-progress-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button, message, Upload } from 'antd';

const props: UploadProps = {
name: 'file',
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
headers: {
authorization: 'authorization-text',
},
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/defaultFileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { UploadProps } from 'antd';
import { Button, Upload } from 'antd';

const props: UploadProps = {
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
onChange({ file, fileList }) {
if (file.status !== 'uploading') {
console.log(file, fileList);
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/directory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { UploadOutlined } from '@ant-design/icons';
import { Button, Upload } from 'antd';

const App: React.FC = () => (
<Upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76" directory>
<Upload action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188" directory>
<Button icon={<UploadOutlined />}>Upload Directory</Button>
</Upload>
);
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/drag-sorting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const App: React.FC = () => {
<DndContext sensors={[sensor]} onDragEnd={onDragEnd}>
<SortableContext items={fileList.map((i) => i.uid)} strategy={verticalListSortingStrategy}>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
fileList={fileList}
onChange={onChange}
itemRender={(originNode, file) => (
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/drag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { Dragger } = Upload;
const props: UploadProps = {
name: 'file',
multiple: true,
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
onChange(info) {
const { status } = info.file;
if (status !== 'uploading') {
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/file-type.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const App: React.FC = () => {
return (
<>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture-card"
fileList={fileList}
onPreview={handlePreview}
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/fileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const App: React.FC = () => {
};

const props = {
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
onChange: handleChange,
multiple: true,
};
Expand Down
4 changes: 2 additions & 2 deletions components/upload/demo/max-count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Button, Space, Upload } from 'antd';
const App: React.FC = () => (
<Space direction="vertical" style={{ width: '100%' }} size="large">
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture"
maxCount={1}
>
<Button icon={<UploadOutlined />}>Upload (Max: 1)</Button>
</Upload>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture"
maxCount={3}
multiple
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/picture-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const App: React.FC = () => {
return (
<>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture-card"
fileList={fileList}
onPreview={handlePreview}
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/picture-circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const App: React.FC = () => {
return (
<>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture-circle"
fileList={fileList}
onPreview={handlePreview}
Expand Down
4 changes: 2 additions & 2 deletions components/upload/demo/picture-style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const fileList: UploadFile[] = [
const App: React.FC = () => (
<>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture"
defaultFileList={[...fileList]}
>
Expand All @@ -36,7 +36,7 @@ const App: React.FC = () => (
<br />
<br />
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188"
listType="picture"
defaultFileList={[...fileList]}
className="upload-list-inline"
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/transform-file.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { UploadProps } from 'antd';
import { Button, Upload } from 'antd';

const props: UploadProps = {
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
listType: 'picture',
beforeUpload(file) {
return new Promise((resolve) => {
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/upload-custom-action-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { UploadProps } from 'antd';
import { Button, Upload } from 'antd';

const props: UploadProps = {
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
action: 'https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188',
onChange({ file, fileList }) {
if (file.status !== 'uploading') {
console.log(file, fileList);
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/upload-manually.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const App: React.FC = () => {
});
setUploading(true);
// You can use any AJAX library you like
fetch('https://www.mocky.io/v2/5cc8019d300000980a055e76', {
fetch('https://run.mocky.io/v3/435e224c-44fb-4773-9faf-380c5e6a2188', {
method: 'POST',
body: formData,
})
Expand Down

1 comment on commit 64b649e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.