mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 17:23:20 +03:00
feat: add partner create endpoint (#21625)
This commit is contained in:
@@ -811,7 +811,10 @@ export type PartnerResponseDto = {
|
||||
profileChangedAt: string;
|
||||
profileImagePath: string;
|
||||
};
|
||||
export type UpdatePartnerDto = {
|
||||
export type PartnerCreateDto = {
|
||||
sharedWithId: string;
|
||||
};
|
||||
export type PartnerUpdateDto = {
|
||||
inTimeline: boolean;
|
||||
};
|
||||
export type PeopleResponseDto = {
|
||||
@@ -3122,6 +3125,21 @@ export function getPartners({ direction }: {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* This endpoint requires the `partner.create` permission.
|
||||
*/
|
||||
export function createPartner({ partnerCreateDto }: {
|
||||
partnerCreateDto: PartnerCreateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 201;
|
||||
data: PartnerResponseDto;
|
||||
}>("/partners", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: partnerCreateDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* This endpoint requires the `partner.delete` permission.
|
||||
*/
|
||||
@@ -3134,9 +3152,9 @@ export function removePartner({ id }: {
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* This endpoint requires the `partner.create` permission.
|
||||
* This property was deprecated in v1.141.0. This endpoint requires the `partner.create` permission.
|
||||
*/
|
||||
export function createPartner({ id }: {
|
||||
export function createPartnerDeprecated({ id }: {
|
||||
id: string;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
@@ -3150,9 +3168,9 @@ export function createPartner({ id }: {
|
||||
/**
|
||||
* This endpoint requires the `partner.update` permission.
|
||||
*/
|
||||
export function updatePartner({ id, updatePartnerDto }: {
|
||||
export function updatePartner({ id, partnerUpdateDto }: {
|
||||
id: string;
|
||||
updatePartnerDto: UpdatePartnerDto;
|
||||
partnerUpdateDto: PartnerUpdateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
@@ -3160,7 +3178,7 @@ export function updatePartner({ id, updatePartnerDto }: {
|
||||
}>(`/partners/${encodeURIComponent(id)}`, oazapfts.json({
|
||||
...opts,
|
||||
method: "PUT",
|
||||
body: updatePartnerDto
|
||||
body: partnerUpdateDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user