feat(sales): enhance opportunity management and add CW integration
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import api from "../axios";
|
||||
|
||||
export interface CWMember {
|
||||
id: number;
|
||||
identifier: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
name: string;
|
||||
officeEmail: string;
|
||||
inactive: boolean;
|
||||
}
|
||||
|
||||
export const cw = {
|
||||
/**
|
||||
* Fetch all ConnectWise members from the server-side member cache.
|
||||
* By default only active members are returned.
|
||||
*/
|
||||
async fetchMembers(
|
||||
accessToken: string,
|
||||
options?: { active?: boolean },
|
||||
): Promise<CWMember[]> {
|
||||
const params: Record<string, string> = {};
|
||||
if (options?.active === false) params.active = "false";
|
||||
|
||||
const response = await api.get("/v1/cw/members", {
|
||||
params,
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
});
|
||||
|
||||
return response.data.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user