Refactor category type to use enum

This commit is contained in:
Walcher 2024-01-25 17:23:17 +01:00 committed by Jakob Stornig
parent 6ca505d505
commit bdc2ca22f6
6 changed files with 22 additions and 15 deletions

View file

@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Text, StyleSheet } from 'react-native';
import { useTheme } from '../../app/contexts/ThemeContext';
import useFetch from '../../hooks/useFetch';
import { CategoryType } from '../../services/database';
const styles = StyleSheet.create({
text: {
@ -23,7 +24,7 @@ const BudgetRemaining = () => {
};
const budgetQuery = {
sql: "SELECT SUM(allocated_amount) as total FROM category WHERE type = 'budget'",
sql: `SELECT SUM(allocated_amount) as total FROM category WHERE type = '${CategoryType.EXPENSE.toString()}'`,
args: []
};