Skip to content

Commit

Permalink
Merge with Pfadi Morea
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonpoet committed Mar 12, 2020
1 parent ef9ac4f commit a69ba53
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
## Compiled JavaScript files
**/*.js
**/*.js.map
Expand All @@ -7,7 +6,6 @@
typings/

node_modules/
=======
# Logs
logs
*.log
Expand Down Expand Up @@ -73,4 +71,3 @@ node_modules/

# dotenv environment variables file
.env
>>>>>>> bf93e082e29525c0f97940c166fce66b406cf6b4
46 changes: 23 additions & 23 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ import { ChildUserMap } from "./cloud_Functions/childUserMap";
import { Messages } from "./cloud_Functions/messages";
export { ParentPendAccept } from "./cloud_Functions/parendPendRequest";

//const db = admin.firestore();
const db = functions.region("europe-west1");
//Changed from Imac
export const anmeldungTeleblitz = functions.region("europe-west1").firestore
export const anmeldungTeleblitz = db.firestore
.document("events/{eventID}/Anmeldungen/{anmeldeUID}")
.onWrite(async (change, context) => {
const tlbz = new Cloud_Teleblitz();
return await tlbz.initfunction(change, context);
});
export const childPendRequest = functions.region("europe-west1").https.onCall(
export const childPendRequest = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const request = new ChildPendRequest();
return await request.request(data, context);
}
);
export const parendPendAccept = functions.region("europe-west1").https.onCall(
export const parendPendAccept = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const accept = new ParentPendAccept();
return await accept.accept(data, context);
}
);
export const deleteUser = functions.region("europe-west1").firestore
export const deleteUser = db.firestore
.document("user/{userID}")
.onDelete(async (snap, context) => {
if (snap.id.length < 25) {
Expand All @@ -53,87 +53,87 @@ export const deleteUser = functions.region("europe-west1").firestore
);
}
});
export const createAccount = functions.region("europe-west1").https.onCall(
export const createAccount = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const accont = new Account();
return accont.create(data);
}
);
export const uploadDevTocken = functions.region("europe-west1").https.onCall(
export const uploadDevTocken = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
return userMap.deviceTokenUpdate(data, context);
}
);
export const updateUserProfile = functions.region("europe-west1").https.onCall(
export const updateUserProfile = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
return userMap.update(data, context);
}
);

export const goToNewGroup = functions.region("europe-west1").https.onCall(
export const goToNewGroup = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const groupMap = new GroupMap();
return groupMap.goToNewGroup(data, context);
}
);
export const priviledgeTN = functions.region("europe-west1").https.onCall(
export const priviledgeTN = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const groupMap = new GroupMap();
const userMap = new UserMap();
await userMap.groupIDUpdate(data, context);
return groupMap.priviledgeTN(data, context);
}
);
export const makeLeiter = functions.region("europe-west1").https.onCall(
export const makeLeiter = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const groupMap = new GroupMap();
return groupMap.makeLeiter(data, context);
}
);
export const pushNotificationOnTeleblitzCreate = functions.region("europe-west1").firestore
export const pushNotificationOnTeleblitzCreate = db.firestore
.document("groups/{groupID}")
.onWrite(async (change, context) => {
const pushNotification = new PushNotificationByTeleblitzCreated();
return pushNotification.groupLevelInit(change, context);
});

export const pushNotificationOnTeleblitzWrite = functions.region("europe-west1").firestore
export const pushNotificationOnTeleblitzWrite = db.firestore
.document("events/{eventID}")
.onWrite(async (change, context) => {
const pushNotification = new PushNotificationByTeleblitzCreated();
return pushNotification.eventLevelInit(change);
});
export const createChildUserMap = functions.region("europe-west1").https.onCall(
export const createChildUserMap = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const childusermap = new ChildUserMap();
return childusermap.create(data, context);
}
);

export const priviledgeEltern = functions.region("europe-west1").https.onCall(
export const priviledgeEltern = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const groupMap = new GroupMap();
return groupMap.priviledgeEltern(data, context);
}
);
export const upgradeChildMap = functions.region("europe-west1").https.onCall(
export const upgradeChildMap = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
await userMap.updateAllParents(data, context);
return userMap.create(data, context);
}
);

export const createUserMap = functions.region("europe-west1").https.onCall(
export const createUserMap = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
return userMap.create(data, context);
}
);

export const deleteUserMap = functions.region("europe-west1").https.onCall(
export const deleteUserMap = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
const groupMap = new GroupMap();
Expand All @@ -142,21 +142,21 @@ export const deleteUserMap = functions.region("europe-west1").https.onCall(
}
);

export const desubFromGroup = functions.region("europe-west1").https.onCall(
export const desubFromGroup = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const groupMap = new GroupMap();
return groupMap.deSubFromGroup(data, context)
}
)

export const deleteChildMap = functions.region("europe-west1").https.onCall(
export const deleteChildMap = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
return userMap.delete(data, context);
}
);

export const updatePriviledge = functions.region("europe-west1").https.onCall(
export const updatePriviledge = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const groupMap = new GroupMap();
const dataupdate = {
Expand All @@ -173,7 +173,7 @@ export const updatePriviledge = functions.region("europe-west1").https.onCall(
}
);

export const uploadAndNotifyMessage = functions.region("europe-west1").https.onCall(
export const uploadAndNotifyMessage = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const messages = new Messages();
console.log(data);
Expand All @@ -182,7 +182,7 @@ export const uploadAndNotifyMessage = functions.region("europe-west1").https.onC
}
);

export const deactivateDeviceNotification = functions.region("europe-west1").https.onCall(
export const deactivateDeviceNotification = db.https.onCall(
async (data: any, context: functions.https.CallableContext) => {
const userMap = new UserMap();
return userMap.deactivateDeviceNotification(data, context);
Expand Down

0 comments on commit a69ba53

Please sign in to comment.