new sdk of staffs to front
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect');
|
||||
|
||||
const BackgroundCheckStatus = {
|
||||
PENDING: "PENDING",
|
||||
CLEARED: "CLEARED",
|
||||
FAILED: "FAILED",
|
||||
EXPIRED: "EXPIRED",
|
||||
}
|
||||
exports.BackgroundCheckStatus = BackgroundCheckStatus;
|
||||
|
||||
const EmploymentType = {
|
||||
FULL_TIME: "FULL_TIME",
|
||||
PART_TIME: "PART_TIME",
|
||||
ON_CALL: "ON_CALL",
|
||||
CONTRACT: "CONTRACT",
|
||||
}
|
||||
exports.EmploymentType = EmploymentType;
|
||||
|
||||
const EventStatus = {
|
||||
DRAFT: "DRAFT",
|
||||
ACTIVE: "ACTIVE",
|
||||
@@ -25,16 +41,16 @@ const connectorConfig = {
|
||||
};
|
||||
exports.connectorConfig = connectorConfig;
|
||||
|
||||
const listEventsRef = (dc) => {
|
||||
const listStaffRef = (dc) => {
|
||||
const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
|
||||
dcInstance._useGeneratedSdk();
|
||||
return queryRef(dcInstance, 'listEvents');
|
||||
return queryRef(dcInstance, 'listStaff');
|
||||
}
|
||||
listEventsRef.operationName = 'listEvents';
|
||||
exports.listEventsRef = listEventsRef;
|
||||
listStaffRef.operationName = 'listStaff';
|
||||
exports.listStaffRef = listStaffRef;
|
||||
|
||||
exports.listEvents = function listEvents(dc) {
|
||||
return executeQuery(listEventsRef(dc));
|
||||
exports.listStaff = function listStaff(dc) {
|
||||
return executeQuery(listStaffRef(dc));
|
||||
};
|
||||
|
||||
const createEventRef = (dcOrVars, vars) => {
|
||||
@@ -48,3 +64,27 @@ exports.createEventRef = createEventRef;
|
||||
exports.createEvent = function createEvent(dcOrVars, vars) {
|
||||
return executeMutation(createEventRef(dcOrVars, vars));
|
||||
};
|
||||
|
||||
const listEventsRef = (dc) => {
|
||||
const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined);
|
||||
dcInstance._useGeneratedSdk();
|
||||
return queryRef(dcInstance, 'listEvents');
|
||||
}
|
||||
listEventsRef.operationName = 'listEvents';
|
||||
exports.listEventsRef = listEventsRef;
|
||||
|
||||
exports.listEvents = function listEvents(dc) {
|
||||
return executeQuery(listEventsRef(dc));
|
||||
};
|
||||
|
||||
const createStaffRef = (dcOrVars, vars) => {
|
||||
const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true);
|
||||
dcInstance._useGeneratedSdk();
|
||||
return mutationRef(dcInstance, 'CreateStaff', inputVars);
|
||||
}
|
||||
createStaffRef.operationName = 'CreateStaff';
|
||||
exports.createStaffRef = createStaffRef;
|
||||
|
||||
exports.createStaff = function createStaff(dcOrVars, vars) {
|
||||
return executeMutation(createStaffRef(dcOrVars, vars));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user