Genealogy as a feature (#175)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Start our journey into turning GeneIT as afully featured family intranet by making genealogy a feature that can be disabled by family admins Reviewed-on: #175
This commit is contained in:
31
geneit_app/src/api/genealogy/DataApi.ts
Normal file
31
geneit_app/src/api/genealogy/DataApi.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { APIClient } from "../ApiClient";
|
||||
|
||||
/**
|
||||
* Data management api client
|
||||
*/
|
||||
export class DataApi {
|
||||
/**
|
||||
* Export the data of a family
|
||||
*/
|
||||
static async ExportData(family_id: number): Promise<Blob> {
|
||||
const res = await APIClient.exec({
|
||||
uri: `/family/${family_id}/genealogy/data/export`,
|
||||
method: "GET",
|
||||
});
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import the data of a family
|
||||
*/
|
||||
static async ImportData(family_id: number, archive: Blob): Promise<Blob> {
|
||||
const fd = new FormData();
|
||||
fd.append("archive", archive);
|
||||
const res = await APIClient.exec({
|
||||
uri: `/family/${family_id}/genealogy/data/import`,
|
||||
method: "PUT",
|
||||
formData: fd,
|
||||
});
|
||||
return res.data;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user