Continued migrating more and more files
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import {app} from "@/firebase";
|
||||
import {getFirestore, collection, getDocs, setDoc, doc, getDoc, deleteDoc, query} from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {CorporateUser, Group} from "@/interfaces/user";
|
||||
|
||||
@@ -4,7 +4,6 @@ import {app} from "@/firebase";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {User} from "@/interfaces/user";
|
||||
import {getFirestore, getDoc, doc} from "firebase/firestore";
|
||||
import client from "@/lib/mongodb";
|
||||
|
||||
const auth = getAuth(app);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import {app} from "@/firebase";
|
||||
import {getFirestore, setDoc, doc, query, collection, where, getDocs, getDoc, deleteDoc, limit, updateDoc} from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {v4} from "uuid";
|
||||
|
||||
@@ -7,8 +7,9 @@ import {sessionOptions} from "@/lib/session";
|
||||
import {Group} from "@/interfaces/user";
|
||||
import {Payment} from "@/interfaces/paypal";
|
||||
import {deleteObject, ref} from "firebase/storage";
|
||||
import client from "@/lib/mongodb";
|
||||
|
||||
const db = getFirestore(app);
|
||||
const db = client.db(process.env.MONGODB_DB);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
@@ -28,10 +29,10 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const {id} = req.query as {id: string};
|
||||
|
||||
const snapshot = await getDoc(doc(db, "payments", id));
|
||||
const payment = await db.collection("payments").findOne<Payment>({id});
|
||||
|
||||
if (snapshot.exists()) {
|
||||
res.status(200).json({...snapshot.data(), id: snapshot.id});
|
||||
if (!!payment) {
|
||||
res.status(200).json(payment);
|
||||
} else {
|
||||
res.status(404).json(undefined);
|
||||
}
|
||||
@@ -45,15 +46,15 @@ async function del(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const {id} = req.query as {id: string};
|
||||
|
||||
const snapshot = await getDoc(doc(db, "payments", id));
|
||||
const data = snapshot.data() as Payment;
|
||||
const payment = await db.collection("payments").findOne<Payment>({id});
|
||||
if (!payment) return res.status(404).json({ok: false});
|
||||
|
||||
const user = req.session.user;
|
||||
if (user.type === "admin" || user.type === "developer") {
|
||||
if (data.commissionTransfer) await deleteObject(ref(storage, data.commissionTransfer));
|
||||
if (data.corporateTransfer) await deleteObject(ref(storage, data.corporateTransfer));
|
||||
if (payment.commissionTransfer) await deleteObject(ref(storage, payment.commissionTransfer));
|
||||
if (payment.corporateTransfer) await deleteObject(ref(storage, payment.corporateTransfer));
|
||||
|
||||
await deleteDoc(snapshot.ref);
|
||||
await db.collection("payments").deleteOne({id: payment.id});
|
||||
res.status(200).json({ok: true});
|
||||
return;
|
||||
}
|
||||
@@ -68,15 +69,17 @@ async function patch(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
const {id} = req.query as {id: string};
|
||||
const snapshot = await getDoc(doc(db, "payments", id));
|
||||
|
||||
const payment = await db.collection("payments").findOne<Payment>({id});
|
||||
if (!payment) return res.status(404).json({ok: false});
|
||||
|
||||
const user = req.session.user;
|
||||
if (user.type === "admin" || user.type === "developer") {
|
||||
await setDoc(snapshot.ref, req.body, {merge: true});
|
||||
await db.collection("payments").updateOne({id: payment.id}, {$set: req.body});
|
||||
|
||||
if (req.body.isPaid) {
|
||||
const corporateID = req.body.corporate;
|
||||
await setDoc(doc(db, "users", corporateID), {status: "active"}, {merge: true});
|
||||
await db.collection("users").updateOne({id: corporateID}, {$set: {status: "active"}});
|
||||
}
|
||||
return res.status(200).json({ok: true});
|
||||
}
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import {app} from "@/firebase";
|
||||
import {
|
||||
getFirestore,
|
||||
collection,
|
||||
getDocs,
|
||||
query,
|
||||
where,
|
||||
} from "firebase/firestore";
|
||||
import {getFirestore, collection, getDocs, query, where} from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {Payment} from "@/interfaces/paypal";
|
||||
import {PaymentsStatus} from "@/interfaces/user.payments";
|
||||
import client from "@/lib/mongodb";
|
||||
|
||||
const db = getFirestore(app);
|
||||
const db = client.db(process.env.MONGODB_DB);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
@@ -30,23 +25,12 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if it's an admin, don't apply query filters
|
||||
const whereClauses = ["admin", "developer"].includes(req.session.user.type)
|
||||
? []
|
||||
: [
|
||||
// where("agent", "==", "xRMirufz6PPQqxKBgvPTWiWKBD63"),
|
||||
where(req.session.user.type, "==", req.session.user.id),
|
||||
// Based on the logic of query we should be able to do this:
|
||||
// where("isPaid", "==", paid === "paid"),
|
||||
// but for some reason it is ignoring all but the first clause
|
||||
// I opted into only fetching relevant content for the user
|
||||
// and then filter it with JS
|
||||
];
|
||||
const payments = await db
|
||||
.collection("payments")
|
||||
.find(["admin", "developer"].includes(req.session.user.type) ? {} : {[req.session.user.type]: req.session.user.id})
|
||||
.toArray();
|
||||
|
||||
const codeQuery = query(collection(db, "payments"), ...whereClauses);
|
||||
|
||||
const snapshot = await getDocs(codeQuery);
|
||||
if (snapshot.empty) {
|
||||
if (payments.length === 0) {
|
||||
res.status(200).json({
|
||||
pending: [],
|
||||
done: [],
|
||||
@@ -54,12 +38,7 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const docs = snapshot.docs.map((doc) => ({
|
||||
id: doc.id,
|
||||
...doc.data(),
|
||||
})) as Payment[];
|
||||
|
||||
const paidStatusEntries = docs.reduce(
|
||||
const paidStatusEntries = payments.reduce(
|
||||
(acc: PaymentsStatus, doc) => {
|
||||
if (doc.isPaid) {
|
||||
return {
|
||||
@@ -76,7 +55,7 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
{
|
||||
pending: [],
|
||||
done: [],
|
||||
}
|
||||
},
|
||||
);
|
||||
res.status(200).json({
|
||||
pending: [...new Set(paidStatusEntries.pending)],
|
||||
|
||||
@@ -8,8 +8,9 @@ import {Group} from "@/interfaces/user";
|
||||
import {Payment} from "@/interfaces/paypal";
|
||||
import {v4} from "uuid";
|
||||
import ShortUniqueId from "short-unique-id";
|
||||
import client from "@/lib/mongodb";
|
||||
|
||||
const db = getFirestore(app);
|
||||
const db = client.db(process.env.MONGODB_DB);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
@@ -24,20 +25,15 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
const snapshot = await getDocs(collection(db, "payments"));
|
||||
const payments = await db.collection("payments").find({}).toArray();
|
||||
|
||||
res.status(200).json(
|
||||
snapshot.docs.map((doc) => ({
|
||||
id: doc.id,
|
||||
...doc.data(),
|
||||
})),
|
||||
);
|
||||
res.status(200).json(payments);
|
||||
}
|
||||
|
||||
async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
const body = req.body as Payment;
|
||||
|
||||
const shortUID = new ShortUniqueId();
|
||||
await setDoc(doc(db, "payments", shortUID.randomUUID(8)), body);
|
||||
await db.collection("payments").insertOne({...body, id: shortUID.randomUUID(8)});
|
||||
res.status(200).json({ok: true});
|
||||
}
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import {app} from "@/firebase";
|
||||
import {
|
||||
getFirestore,
|
||||
getDocs,
|
||||
collection,
|
||||
} from "firebase/firestore";
|
||||
import {getFirestore, getDocs, collection} from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import client from "@/lib/mongodb";
|
||||
|
||||
const db = getFirestore(app);
|
||||
const db = client.db(process.env.MONGODB_DB);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
const payments = await getDocs(collection(db, "paypalpayments"));
|
||||
const payments = await db.collection("paypalpayments").find({}).toArray();
|
||||
|
||||
const data = payments.docs.map((doc) => doc.data());
|
||||
res.status(200).json(data);
|
||||
res.status(200).json(payments);
|
||||
}
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import { app } from "@/firebase";
|
||||
import { getFirestore, collection, getDocs } from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import axios from "axios";
|
||||
@@ -9,18 +7,14 @@ import { v4 } from "uuid";
|
||||
import {OrderResponseBody} from "@paypal/paypal-js";
|
||||
import {getAccessToken} from "@/utils/paypal";
|
||||
|
||||
const db = getFirestore(app);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (req.method !== "POST")
|
||||
return res.status(404).json({ ok: false, reason: "Method not supported!" });
|
||||
if (req.method !== "POST") return res.status(404).json({ok: false, reason: "Method not supported!"});
|
||||
if (!req.session.user) return res.status(401).json({ok: false});
|
||||
|
||||
const accessToken = await getAccessToken();
|
||||
if (!accessToken)
|
||||
return res.status(401).json({ ok: false, reason: "Authorization failed!" });
|
||||
if (!accessToken) return res.status(401).json({ok: false, reason: "Authorization failed!"});
|
||||
|
||||
const {currencyCode, price, trackingId} = req.body as {
|
||||
currencyCode: string;
|
||||
@@ -28,8 +22,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
trackingId: string;
|
||||
};
|
||||
|
||||
if (!trackingId)
|
||||
return res.status(401).json({ ok: false, reason: "Missing tracking id!" });
|
||||
if (!trackingId) return res.status(401).json({ok: false, reason: "Missing tracking id!"});
|
||||
|
||||
const url = `${process.env.PAYPAL_ACCESS_TOKEN_URL}/v2/checkout/orders`;
|
||||
const amount = {
|
||||
@@ -95,7 +88,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
url,
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
axios
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import { app } from "@/firebase";
|
||||
import { getFirestore, collection, getDocs } from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import axios from "axios";
|
||||
@@ -9,19 +7,15 @@ import { v4 } from "uuid";
|
||||
import {OrderResponseBody} from "@paypal/paypal-js";
|
||||
import {getAccessToken} from "@/utils/paypal";
|
||||
|
||||
const db = getFirestore(app);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (req.method !== "PUT")
|
||||
return res.status(404).json({ ok: false, reason: "Method not supported!" });
|
||||
if (req.method !== "PUT") return res.status(404).json({ok: false, reason: "Method not supported!"});
|
||||
|
||||
if (!req.session.user) return res.status(401).json({ok: false});
|
||||
|
||||
const accessToken = await getAccessToken();
|
||||
if (!accessToken)
|
||||
return res.status(401).json({ ok: false, reason: "Authorization failed!" });
|
||||
if (!accessToken) return res.status(401).json({ok: false, reason: "Authorization failed!"});
|
||||
|
||||
const trackingId = `${req.session.user.id}-${Date.now()}`;
|
||||
|
||||
@@ -40,11 +34,13 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
};
|
||||
console.log(JSON.stringify({
|
||||
console.log(
|
||||
JSON.stringify({
|
||||
url,
|
||||
data,
|
||||
headers,
|
||||
}));
|
||||
}),
|
||||
);
|
||||
try {
|
||||
const request = await axios.put(url, data, headers);
|
||||
|
||||
@@ -54,8 +50,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(url, err);
|
||||
return res
|
||||
.status(500)
|
||||
.json({ ok: false, reason: "Failed to create tracking ID" });
|
||||
return res.status(500).json({ok: false, reason: "Failed to create tracking ID"});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,10 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import { app } from "@/firebase";
|
||||
import {
|
||||
getFirestore,
|
||||
collection,
|
||||
getDocs,
|
||||
query,
|
||||
where,
|
||||
doc,
|
||||
setDoc,
|
||||
addDoc,
|
||||
getDoc,
|
||||
deleteDoc,
|
||||
} from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {Permission} from "@/interfaces/permissions";
|
||||
import {bootstrap} from "@/utils/permissions.be";
|
||||
|
||||
const db = getFirestore(app);
|
||||
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
@@ -3,7 +3,6 @@ import {createUserWithEmailAndPassword, getAuth} from "firebase/auth";
|
||||
import {app} from "@/firebase";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {getFirestore, doc, setDoc, query, collection, where, getDocs} from "firebase/firestore";
|
||||
import {Code, CorporateInformation, DemographicInformation, Group, Type} from "@/interfaces/user";
|
||||
import {addUserToGroupOnCreation} from "@/utils/registration";
|
||||
import moment from "moment";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type {NextApiRequest, NextApiResponse} from "next";
|
||||
import {app} from "@/firebase";
|
||||
import {getFirestore, doc, getDoc, deleteDoc} from "firebase/firestore";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {Session} from "@/hooks/useSessions";
|
||||
|
||||
@@ -7,11 +7,7 @@ import formidable from "formidable-serverless";
|
||||
import {getDownloadURL, ref, uploadBytes} from "firebase/storage";
|
||||
import fs from "fs";
|
||||
import {app, storage} from "@/firebase";
|
||||
import {doc, getDoc, getFirestore, setDoc} from "firebase/firestore";
|
||||
import {Stat} from "@/interfaces/user";
|
||||
import {speakingReverseMarking} from "@/utils/score";
|
||||
|
||||
const db = getFirestore(app);
|
||||
export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
@@ -7,9 +7,11 @@ import {getAuth} from "firebase-admin/auth";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {NextApiRequest, NextApiResponse} from "next";
|
||||
import {getPermissions, getPermissionDocs} from "@/utils/permissions.be";
|
||||
import client from "@/lib/mongodb";
|
||||
import {getGroupsForUser, getParticipantGroups} from "@/utils/groups.be";
|
||||
|
||||
const db = getFirestore(app);
|
||||
const auth = getAuth(adminApp);
|
||||
const db = client.db(process.env.MONGODB_DB);
|
||||
|
||||
export default withIronSessionApiRoute(user, sessionOptions);
|
||||
|
||||
@@ -28,36 +30,26 @@ async function del(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const {id} = req.query as {id: string};
|
||||
|
||||
const docUser = await getDoc(doc(db, "users", req.session.user.id));
|
||||
if (!docUser.exists()) {
|
||||
const user = await db.collection("users").findOne<User>({id: req.session.user.id});
|
||||
if (!user) {
|
||||
res.status(401).json({ok: false});
|
||||
return;
|
||||
}
|
||||
|
||||
const user = docUser.data() as User;
|
||||
|
||||
const docTargetUser = await getDoc(doc(db, "users", id));
|
||||
if (!docTargetUser.exists()) {
|
||||
const targetUser = await db.collection("users").findOne<User>({id});
|
||||
if (!targetUser) {
|
||||
res.status(404).json({ok: false});
|
||||
return;
|
||||
}
|
||||
|
||||
const targetUser = {...docTargetUser.data(), id: docTargetUser.id} as User;
|
||||
|
||||
if (user.type === "corporate" && (targetUser.type === "student" || targetUser.type === "teacher")) {
|
||||
const userParticipantGroup = await getDocs(query(collection(db, "groups"), where("participants", "array-contains", id)));
|
||||
const groups = await getGroupsForUser(user.id, targetUser.id);
|
||||
await Promise.all([
|
||||
...userParticipantGroup.docs
|
||||
.filter((x) => (x.data() as Group).admin === user.id)
|
||||
...groups
|
||||
.filter((x) => x.admin === user.id)
|
||||
.map(
|
||||
async (x) =>
|
||||
await setDoc(
|
||||
x.ref,
|
||||
{
|
||||
participants: x.data().participants.filter((y: string) => y !== id),
|
||||
},
|
||||
{merge: true},
|
||||
),
|
||||
await db.collection("groups").updateOne({id: x.id}, {$set: {participants: x.participants.filter((y: string) => y !== id)}}),
|
||||
),
|
||||
]);
|
||||
|
||||
@@ -65,41 +57,30 @@ async function del(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
await auth.deleteUser(id);
|
||||
await deleteDoc(doc(db, "users", id));
|
||||
const userCodeDocs = await getDocs(query(collection(db, "codes"), where("userId", "==", id)));
|
||||
const userParticipantGroup = await getDocs(query(collection(db, "groups"), where("participants", "array-contains", id)));
|
||||
const userGroupAdminDocs = await getDocs(query(collection(db, "groups"), where("admin", "==", id)));
|
||||
const userStatsDocs = await getDocs(query(collection(db, "stats"), where("user", "==", id)));
|
||||
await db.collection("users").deleteOne({id: targetUser.id});
|
||||
await db.collection("codes").deleteMany({userId: targetUser.id});
|
||||
await db.collection("groups").deleteMany({admin: targetUser.id});
|
||||
await db.collection("stats").deleteMany({user: targetUser.id});
|
||||
|
||||
await Promise.all([
|
||||
...userCodeDocs.docs.map(async (x) => await deleteDoc(x.ref)),
|
||||
...userGroupAdminDocs.docs.map(async (x) => await deleteDoc(x.ref)),
|
||||
...userStatsDocs.docs.map(async (x) => await deleteDoc(x.ref)),
|
||||
...userParticipantGroup.docs.map(
|
||||
async (x) =>
|
||||
await setDoc(
|
||||
x.ref,
|
||||
{
|
||||
participants: x.data().participants.filter((y: string) => y !== id),
|
||||
},
|
||||
{merge: true},
|
||||
const groups = await getParticipantGroups(targetUser.id);
|
||||
await Promise.all(
|
||||
groups.map(
|
||||
async (x) => await db.collection("groups").updateOne({id: x.id}, {$set: {participants: x.participants.filter((y: string) => y !== id)}}),
|
||||
),
|
||||
),
|
||||
]);
|
||||
);
|
||||
|
||||
res.json({ok: true});
|
||||
}
|
||||
|
||||
async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (req.session.user) {
|
||||
const docUser = await getDoc(doc(db, "users", req.session.user.id));
|
||||
if (!docUser.exists()) {
|
||||
const user = await db.collection("users").findOne<User>({id: req.session.user.id});
|
||||
if (!user) {
|
||||
res.status(401).json(undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
const user = docUser.data() as User;
|
||||
await setDoc(docUser.ref, {lastLogin: new Date().toISOString()}, {merge: true});
|
||||
await db.collection("users").updateOne({id: user.id}, {$set: {lastLogin: new Date().toISOString()}});
|
||||
|
||||
req.session.user = {
|
||||
...user,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {collection, doc, getDoc, getDocs, getFirestore, query, setDoc, where} from "firebase/firestore";
|
||||
import {app} from "@/firebase";
|
||||
import {Group, Type, User} from "@/interfaces/user";
|
||||
import {uuidv4} from "@firebase/util";
|
||||
|
||||
@@ -1,22 +1,3 @@
|
||||
import {app} from "@/firebase";
|
||||
|
||||
import {
|
||||
collection,
|
||||
doc,
|
||||
documentId,
|
||||
endAt,
|
||||
endBefore,
|
||||
getCountFromServer,
|
||||
getDoc,
|
||||
getDocs,
|
||||
getFirestore,
|
||||
limit,
|
||||
orderBy,
|
||||
query,
|
||||
startAfter,
|
||||
startAt,
|
||||
where,
|
||||
} from "firebase/firestore";
|
||||
import {CorporateUser, Group, Type, User} from "@/interfaces/user";
|
||||
import {getGroupsForUser, getParticipantGroups, getUserGroups, getUsersGroups} from "./groups.be";
|
||||
import {last, uniq, uniqBy} from "lodash";
|
||||
|
||||
Reference in New Issue
Block a user