Next release WIP #
This commit is contained in:
parent
7d7944fa90
commit
20078ccacc
10 changed files with 219 additions and 94 deletions
|
|
@ -19,11 +19,13 @@ export interface Ticket {
|
|||
export interface ZammadClient {
|
||||
ticket: {
|
||||
create: (data: any) => Promise<Ticket>;
|
||||
update: (id: number, data: any) => Promise<Ticket>;
|
||||
};
|
||||
user: {
|
||||
search: (data: any) => Promise<User[]>;
|
||||
create: (data: any) => Promise<User>;
|
||||
};
|
||||
get: (path: string) => Promise<any>;
|
||||
}
|
||||
|
||||
export type ZammadCredentials =
|
||||
|
|
@ -73,6 +75,10 @@ export const Zammad = (
|
|||
const { payload: result } = await wreck.post("tickets", { payload });
|
||||
return result as Ticket;
|
||||
},
|
||||
update: async (id, payload) => {
|
||||
const { payload: result } = await wreck.put(`tickets/${id}`, { payload });
|
||||
return result as Ticket;
|
||||
},
|
||||
},
|
||||
user: {
|
||||
search: async (query) => {
|
||||
|
|
@ -85,6 +91,10 @@ export const Zammad = (
|
|||
return result as User;
|
||||
},
|
||||
},
|
||||
get: async (path) => {
|
||||
const { payload: result } = await wreck.get(path);
|
||||
return result;
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue