Skip to content

Commit

Permalink
Fix categories
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Nov 16, 2023
1 parent 6c6f730 commit 0374fe7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion apps/dashboard/src/components/select-category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const categories = [
"equipment",
"activity",
"other",
"uncategorized",
];

export function SelectCategory({ id, name, selectedId, isLoading }) {
Expand All @@ -59,7 +60,7 @@ export function SelectCategory({ id, name, selectedId, isLoading }) {
description: `Do you want to mark ${
transactions?.data?.length
} similar transactions form ${name} as ${t(
`categories.${value}`,
`categories.${value}`
)} too?`,
action: (
<ToastAction altText="Yes" onClick={handleUpdateSimilar}>
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions packages/email/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ const messages = {
"transactions.title1": "Du har ",
"transactions.title2":
"{numberOfTransactions, plural, =1 {1 transaktion} other {# transaktioner}}",
"transactions.title3": "som det saknas",
"transactions.title3": "som saknar",
"transactions.title4": "kvitton",
"transactions.description1": "Hej {firstName}",
"transactions.description2": "Vi hittade",
"transactions.description3":
"{numberOfTransactions, plural, =1 {1 transaktion} other {# transaktioner}}",
"transactions.description4":
"som det saknas kvitton. Bifoga dem gärna för att underlätta ditt eget eller dina revisorers arbete inför kommande deklarationer",
"som saknar kvitton. Bifoga dem gärna för att underlätta ditt eget eller dina revisorers arbete inför kommande deklarationer",
"transactions.button": "Visa transaktioner",
"transactions.footer":
" Nam imperdiet congue volutpat. Nulla quis facilisis lacus. Vivamus convallis sit amet lectus eget tincidunt. Vestibulum vehicula rutrum nisl, sed faucibus neque. Donec lacus mi, rhoncus at dictum eget, pulvinar at metus. Donec cursus tellus erat, a hendrerit elit rutrum ut. Fusce quis tristique ligula. Etiam sit amet enim vitae mauris auctor blandit id et nibh.",
"transactions.settings": "Notifikationsinställningar",
"transactions.settings": "Inställningar",
"transactions.amount": "Belopp",
"transactions.date": "Datum",
"transactions.description": "Beskrivning",
Expand Down
2 changes: 1 addition & 1 deletion packages/email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@formatjs/intl": "^2.9.9",
"@react-email/components": "0.0.7",
"@react-email/components": "0.0.11",
"date-fns": "^2.30.0",
"react-email": "1.9.5"
},
Expand Down
16 changes: 8 additions & 8 deletions packages/supabase/src/mutations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function createBankAccounts(supabase: Client, accounts) {
bic: account.bic,
currency: account.currency,
owner_name: account.owner_name,
})),
}))
)
.select();
}
Expand All @@ -49,7 +49,7 @@ type UpdateBankConnectionData = {

export async function updateBankConnection(
supabase: Client,
data: UpdateBankConnectionData,
data: UpdateBankConnectionData
) {
const { id, teamId } = data;

Expand All @@ -70,22 +70,22 @@ type CreateTransactionsData = {

export async function createTransactions(
supabase: Client,
data: CreateTransactionsData,
data: CreateTransactionsData
) {
const { transactions, teamId } = data;

return supabase.from("transactions").insert(
transactions.map((transaction) => ({
...transaction,
team_id: teamId,
})),
}))
);
}

export async function updateTransaction(
supabase: Client,
id: string,
data: any,
data: any
) {
return supabase
.from("transactions")
Expand Down Expand Up @@ -142,7 +142,7 @@ export async function updateSimilarTransactions(supabase: Client, id: string) {
.update({ category: transaction.data.category })
.eq("name", transaction.data.name)
.eq("team_id", userData?.team_id)
.is("category", null)
.eq("category", "uncategorized")
.select("id, team_id");
}

Expand All @@ -156,7 +156,7 @@ export type Attachment = {

export async function createAttachments(
supabase: Client,
attachments: Attachment[],
attachments: Attachment[]
) {
const { data: userData } = await getCurrentUserTeamQuery(supabase);

Expand All @@ -166,7 +166,7 @@ export async function createAttachments(
attachments.map((attachment) => ({
...attachment,
team_id: userData?.team_id,
})),
}))
)
.select();

Expand Down
4 changes: 2 additions & 2 deletions packages/supabase/src/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export async function getTransactionsQuery(
}

if (category === "exclude") {
query.is("category", null);
query.eq("category", "uncategorized");
}

if (category === "include") {
Expand Down Expand Up @@ -332,7 +332,7 @@ export async function getSimilarTransactions(
.select("id, amount", { count: "exact" })
.eq("name", transaction.data.name)
.eq("team_id", teamId)
.is("category", null)
.eq("category", "uncategorized")
.throwOnError();
}

Expand Down

0 comments on commit 0374fe7

Please sign in to comment.