feat: make text source optional

This commit is contained in:
shiweisong.ssw 2023-06-29 10:23:54 +08:00
parent 0ea1ec032d
commit bcf897d50a
2 changed files with 4 additions and 12 deletions

View File

@ -296,9 +296,9 @@ const Documents = () => {
</>
) : (
<>
Source:
Text Source(Optional):
<Input
placeholder="Please input the source"
placeholder="Please input the text source"
onChange={(e: any) => setTextSource(e.target.value)}
sx={{ marginBottom: '20px' }}
/>
@ -395,10 +395,6 @@ const Documents = () => {
message.error(data.err_msg || 'failed')
}
} else {
if (textSource === '') {
message.error('Please input the source')
return
}
if (text === '') {
message.error('Please input the text')
return

View File

@ -308,9 +308,9 @@ const Index = () => {
</>
) : (
<>
Source:
Text Source(Optional):
<Input
placeholder="Please input the source"
placeholder="Please input the text source"
onChange={(e: any) => setTextSource(e.target.value)}
sx={{ marginBottom: '20px' }}
/>
@ -379,10 +379,6 @@ const Index = () => {
message.error(data.err_msg || 'failed')
}
} else {
if (textSource === '') {
message.error('Please input the source')
return
}
if (text === '') {
message.error('Please input the text')
return