mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-11 10:27:01 +02:00
refactor: simplify create share function
This commit is contained in:
@@ -12,16 +12,7 @@ import {
|
|||||||
import api from "./api.service";
|
import api from "./api.service";
|
||||||
|
|
||||||
const create = async (share: CreateShare) => {
|
const create = async (share: CreateShare) => {
|
||||||
const { id, expiration, recipients, security, description } = share;
|
return (await api.post("shares", share)).data;
|
||||||
return (
|
|
||||||
await api.post("shares", {
|
|
||||||
id,
|
|
||||||
expiration,
|
|
||||||
recipients,
|
|
||||||
security,
|
|
||||||
description,
|
|
||||||
})
|
|
||||||
).data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const completeShare = async (id: string) => {
|
const completeShare = async (id: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user