This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export interface IWithPaginatorProps {} | |
export interface IWithPaginatorState { | |
paginador: { | |
offset: number; | |
actual: number; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Si me funciona | |
async beforeRouteEnter(from: Route, to: Route, next: any) { | |
next((vm: Login) => { | |
if (vm.isLogged === true) { | |
next('/secret'); | |
} | |
}); | |
} | |
// No me funciona |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//En el módulo order.js modificar la db.collection así | |
db.collection('orders').doc(orderId).set({ | |
oid: orderId, | |
products: data.products, | |
totalCost: data.totalCost, | |
customer_id: rootState.authModule.user.uid, | |
createdAt: moment(new Date).format("DD/MM/YYYY") | |
}) | |
//Luego seguir como en el curso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
exports.newOrder = functions.firestore | |
.document('orders/{orderId}') | |
.onCreate((snap, context)=> { | |
const order = snap.data(); | |
return admin.firestore().collection('orders').doc(order.oid).get().then(snap => { | |
return admin.firestore().collection('messages').doc(order.oid).set( |