Skip to content

Commit

Permalink
🚑 fix default categories
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashshah committed Mar 14, 2022
1 parent bebc0a3 commit 7908f28
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 13 deletions.
8 changes: 5 additions & 3 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import express from "express";
import express, { Request, Response } from "express";
import cors from "cors";
import helmet from "helmet";
import mongoose, { ConnectOptions } from "mongoose";
Expand All @@ -16,8 +16,10 @@ app.use(helmet());
app.use(cors());
app.use(express.json());

app.get("/", (req, res) => {
res.send("Hello World");
app.get("/", (_: Request, res: Response) => {
res.send(
"Welcome to expense tracker backend, please have a look at the github repo for the link to the app"
);
});

app.use("/account", userRoutes);
Expand Down
69 changes: 59 additions & 10 deletions backend/util/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,73 @@ export const createDefaultCategories = async (userId: string) => {
try {
const categories = [
{
type: "income",
name: "Salary",
icon: "fas fa-money-bill-wave",
color: "#00b894",
type: "expense",
name: "Groceries",
icon: "shopping-cart",
color: "#FE9200",
user: userId,
},
{
type: "expense",
name: "Expense",
icon: "fas fa-money-bill-wave",
color: "#e84393",
name: "Electricity",
icon: "loader",
color: "#000000",
user: userId,
},
{
type: "expense",
name: "Groceries",
icon: "fas fa-utensils",
color: "#e84393",
name: "Music",
icon: "music",
color: "#A4DD00",
user: userId,
},
{
type: "expense",
name: "Rent",
icon: "home",
color: "#68CCCA",
user: userId,
},
{
type: "expense",
name: "Mobile Bill",
icon: "smartphone",
color: "#0C797D",
user: userId,
},
{
type: "expense",
name: "Transport",
icon: "truck",
color: "#999999",
user: userId,
},
{
type: "expense",
name: "Gadgets",
icon: "headphones",
color: "#AB149E",
user: userId,
},
{
type: "income",
name: "Salary",
icon: "briefcase",
color: "#AEA1FF",
user: userId,
},
{
type: "income",
name: "Bonus",
icon: "gift",
color: "#16A5A5",
user: userId,
},
{
type: "income",
name: "Interest",
icon: "calendar",
color: "#653294",
user: userId,
},
];
Expand Down

0 comments on commit 7908f28

Please sign in to comment.