feat: allow multiple shares with one reverse share link

This commit is contained in:
Elias Schneider
2023-02-10 11:10:07 +01:00
parent edc10b72b7
commit ccdf8ea3ae
12 changed files with 171 additions and 75 deletions

View File

@@ -47,6 +47,7 @@ const Body = ({
const form = useForm({
initialValues: {
maxShareSize: 104857600,
maxUseCount: 1,
sendEmailNotification: false,
expiration_num: 1,
expiration_unit: "-days",
@@ -60,6 +61,7 @@ const Body = ({
.createReverseShare(
values.expiration_num + values.expiration_unit,
values.maxShareSize,
values.maxUseCount,
values.sendEmailNotification
)
.then(({ link }) => {
@@ -132,6 +134,15 @@ const Body = ({
value={form.values.maxShareSize}
onChange={(number) => form.setFieldValue("maxShareSize", number)}
/>
<NumberInput
min={1}
max={1000}
precision={0}
variant="filled"
label="Max use count"
description="The maximum number of times this reverse share link can be used"
{...form.getInputProps("maxUseCount")}
/>
{showSendEmailNotificationOption && (
<Switch
mt="xs"