diff --git a/frontend/src/APIClients/Mutations/StaffMutations.ts b/frontend/src/APIClients/Mutations/StaffMutations.ts new file mode 100644 index 00000000..2a39d8c0 --- /dev/null +++ b/frontend/src/APIClients/Mutations/StaffMutations.ts @@ -0,0 +1,51 @@ +import {gql} from "@apollo/client"; + +export const ADD_STAFF = gql` +mutation AddStaff($staff: CreateStaffDTO!) { + addStaff(staff: $staff) { + userId + email + phoneNumber + firstName + lastName + displayName + profilePictureURL + isActive + isAdmin + } +} +` +; + +export const UPDATE_STAFF = gql` + mutation UpdateStaff($userId: userID!, $staff: UpdateStaffDTO!) { + updateStaff(userId: $userId, staff: $staff) { + userId + email + phoneNumber + firstName + lastName + displayName + profilePictureURL + isActive + isAdmin + } + } +`; + +export const DELETE_STAFF = gql` + mutation DeleteStaff($userId: ID!) { + deleteStaff(userId: $userId) { + userId + email + phoneNumber + firstName + lastName + displayName + profilePictureURL + isActive + isAdmin + } + } +`; + diff --git a/frontend/src/APIClients/Queries/StaffQueries.ts b/frontend/src/APIClients/Queries/StaffQueries.ts new file mode 100644 index 00000000..3a6ba6c4 --- /dev/null +++ b/frontend/src/APIClients/Queries/StaffQueries.ts @@ -0,0 +1,33 @@ +import {gql} from "@apollo/client"; + +export const GET_ALL_STAFF = gql` + query GetAllStaff { + getAllStaff { + userId + email + phoneNumber + firstName + lastName + displayName + profilePictureURL + isActive + isAdmin + } + } +`; + +export const GET_STAFF_BY_IDS = gql` + query GetStaffByIds { + getStaffByIds { + userId + email + phoneNumber + firstName + lastName + displayName + profilePictureURL + isActive + isAdmin + } + } +`; diff --git a/frontend/src/APIClients/Types/StaffTypes.ts b/frontend/src/APIClients/Types/StaffTypes.ts new file mode 100644 index 00000000..0c77e85a --- /dev/null +++ b/frontend/src/APIClients/Types/StaffTypes.ts @@ -0,0 +1,61 @@ +export type UserRequest = { + userId?: string; + email: string; + password: string; + phoneNumber?: string; + firstName: string; + lastName: string; + isAdmin: boolean; + displayName?: string; + profilePictureURL?: string; + isActive: boolean; + }; + +export type UserRequestID = { + userId: string; + email: string; + password: string; + phoneNumber?: string; + firstName: string; + lastName: string; + isAdmin: boolean; + displayName?: string; + profilePictureURL?: string; + isActive: boolean; + }; + + export type UserRequestAdd = { + userId?: number; + email: string; + phoneNumber: string; + firstName: string; + lastName: string; + displayName: string; + profilePictureURL?: string; + isActive: boolean; + isAdmin: boolean; +}; + +export type UserRequestUpdate = { + userId: number; + email?: string; + phoneNumber?: string; + firstName?: string; + lastName?: string; + displayName?: string; + profilePictureURL?: string; + isActive?: boolean; + isAdmin?: boolean; + }; + + export type UserRequestDelete = { + userId: number; + email?: string; + phoneNumber?: string; + firstName?: string; + lastName?: string; + displayName?: string; + profilePictureURL?: string; + isActive?: boolean; + isAdmin?: boolean; +}; \ No newline at end of file