feat: implement auth flow and app initialization
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
PaginationParams,
|
||||
} from '@/types';
|
||||
|
||||
const PACKAGES_ENDPOINT = 'biz/api/v1/packages';
|
||||
|
||||
/**
|
||||
* Package Service
|
||||
*/
|
||||
@@ -17,7 +19,7 @@ export const packageService = {
|
||||
getPackages: async (params?: PaginationParams): Promise<PaginatedResponse<Package>> => {
|
||||
const skip = params?.skip ?? 0;
|
||||
const limit = params?.limit ?? 100;
|
||||
const response = await axiosClient.get<PaginatedResponse<Package>>(`/packages/`, {
|
||||
const response = await axiosClient.get<PaginatedResponse<Package>>(PACKAGES_ENDPOINT, {
|
||||
params: { skip, limit },
|
||||
});
|
||||
return response.data;
|
||||
@@ -32,7 +34,7 @@ export const packageService = {
|
||||
): Promise<PaginatedResponse<Package>> => {
|
||||
const skip = params?.skip ?? 0;
|
||||
const limit = params?.limit ?? 100;
|
||||
const response = await axiosClient.get<PaginatedResponse<Package>>(`/packages/`, {
|
||||
const response = await axiosClient.get<PaginatedResponse<Package>>(PACKAGES_ENDPOINT, {
|
||||
params: { project_id: projectId, skip, limit },
|
||||
});
|
||||
return response.data;
|
||||
@@ -42,7 +44,7 @@ export const packageService = {
|
||||
* Create a new package
|
||||
*/
|
||||
createPackage: async (data: PackageCreate): Promise<Package> => {
|
||||
const response = await axiosClient.post<Package>('/packages/', data);
|
||||
const response = await axiosClient.post<Package>(PACKAGES_ENDPOINT, data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -50,7 +52,7 @@ export const packageService = {
|
||||
* Update an existing package
|
||||
*/
|
||||
updatePackage: async (packageId: string, data: PackageUpdate): Promise<Package> => {
|
||||
const response = await axiosClient.put<Package>(`/packages/${packageId}`, data);
|
||||
const response = await axiosClient.put<Package>(`${PACKAGES_ENDPOINT}/${packageId}`, data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -58,7 +60,9 @@ export const packageService = {
|
||||
* Delete a package
|
||||
*/
|
||||
deletePackage: async (packageId: string): Promise<{ message: string }> => {
|
||||
const response = await axiosClient.delete<{ message: string }>(`/packages/${packageId}`);
|
||||
const response = await axiosClient.delete<{ message: string }>(
|
||||
`${PACKAGES_ENDPOINT}/${packageId}`,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user