Verified Giphy

This commit is contained in:
Ayushya Amitabh
2020-04-28 23:27:17 -04:00
parent a169fde183
commit 2e6d943b9e
7 changed files with 28 additions and 174 deletions
+9 -9
View File
@@ -88,8 +88,8 @@ const createRoom = async (req, res) => {
.add({
name: bodydata.roomName,
player: bodydata.player,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
createdAt: new Date(),
updatedAt: new Date(),
})
.then((ref) => ref.id)
.catch((err) => {
@@ -105,7 +105,7 @@ const createRoom = async (req, res) => {
uid: '<system>',
name: '',
text: `${bodydata.userName} started the party.`,
time: new Date().toISOString(),
time: new Date(),
})
.catch((err) => {
console.error(`Failed to add system create party message : \n\t Room: ${roomId}`, err);
@@ -176,7 +176,7 @@ const joinRoom = async (req, res) => {
uid: '<system>',
name: '',
text: `${bodydata.userName} joined the party.`,
time: new Date().toISOString(),
time: new Date(),
})
.catch((err) => {
console.error(
@@ -205,7 +205,7 @@ const joinRoom = async (req, res) => {
.collection('rooms')
.doc(bodydata.roomId)
.update({
updatedAt: new Date().toISOString(),
updatedAt: new Date(),
})
.catch((err) => {
console.error(
@@ -239,7 +239,7 @@ const sendMessage = async (req, res) => {
.add({
name,
text: text || '',
time,
time: new Date(),
uid,
type: type || '',
})
@@ -252,7 +252,7 @@ const sendMessage = async (req, res) => {
.collection('rooms')
.doc(roomId)
.update({
updatedAt: new Date().toISOString(),
updatedAt: new Date(),
})
.catch((err) => {
console.error(
@@ -409,7 +409,7 @@ const updatePlayer = async (req, res) => {
uid: '<system>',
name: '',
text: `${userName} ${statusString} ${timeString}`,
time: new Date().toISOString(),
time: new Date(),
})
.catch((err) => {
console.error(
@@ -445,7 +445,7 @@ app.post('/updatePlayer', updatePlayer);
exports.widgets = functions.https.onRequest(app);
exports.scheduledCleanUp = functions.pubsub.schedule('every 60 minutes').onRun(async () => {
const startedTime = new Date().toISOString();
const startedTime = new Date();
const roomList = await admin
.firestore()
.collection('rooms')