This is my function, getAccountType
import { firebaseAdmin } from './index';
export const getAccountType = async (data: any, context: any) => {
const uid = context.auth.uid;
try{
const snapshot = await firebaseAdmin.firestore().collection('users').doc(uid).get();
if(snapshot.exists){
const data = snapshot.data() as { accountType : 'youth' | 'prof', firstName : string, isProfileComplete : boolean};
return data;
}
else{
return { message : "User does not exist"};
};
} catch(e){
return { message : `Failed to get user data ${e}` };
};
};
And this is my index.ts file
import * as functions from "firebase-functions";
import * as admin from 'firebase-admin';
import { helloWorld } from "./helloWorld";
import { getAccountType } from "./getAccountType";
export const firebaseAdmin = admin.initializeApp();
exports.helloWorld = functions.https.onCall(helloWorld)
exports.getAccountType = functions.https.onCall(getAccountType)
And here is the error I receive
i functions: preparing functions directory for uploading...
Error: Error occurred while parsing your function triggers. Please ensure that index.js only exports cloud functions.
The HelloWorld function deploys just fine, but for some reason firebase thinks getAccountType is not a cloud function