feat: Consumption persistence
This commit is contained in:
1 parent
617650929a
commit
9915189d6e
1 file changed
+1
-3
@@ -1,7 +1,7 @@
|
|||||||
import {defineStore} from "pinia";
|
import {defineStore} from "pinia";
|
||||||
import {computed, ref} from "vue";
|
import {computed, ref} from "vue";
|
||||||
import {acquisitionApi, activityApi} from "@/mammon";
|
import {acquisitionApi, activityApi} from "@/mammon";
|
||||||
import {AcquisitionResponse, ActivitySourceResponse} from "@/generated/mammon";
|
import {AcquisitionResponse} from "@/generated/mammon";
|
||||||
import {onActivitiesProcessed} from "@/activity";
|
import {onActivitiesProcessed} from "@/activity";
|
||||||
|
|
||||||
export type RawAcquiredType = {
|
export type RawAcquiredType = {
|
||||||
@@ -12,7 +12,6 @@ export type RawAcquiredType = {
|
|||||||
remaining: number;
|
remaining: number;
|
||||||
price: number;
|
price: number;
|
||||||
date: Date;
|
date: Date;
|
||||||
source: ActivitySourceResponse;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const toAcquiredType = (a: AcquisitionResponse): RawAcquiredType => ({
|
export const toAcquiredType = (a: AcquisitionResponse): RawAcquiredType => ({
|
||||||
@@ -23,7 +22,6 @@ export const toAcquiredType = (a: AcquisitionResponse): RawAcquiredType => ({
|
|||||||
remaining: a.remaining,
|
remaining: a.remaining,
|
||||||
price: a.unitCost,
|
price: a.unitCost,
|
||||||
date: new Date(a.datetime),
|
date: new Date(a.datetime),
|
||||||
source: a.source,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const useAcquiredTypesStore = defineStore('market-acquisition', () => {
|
export const useAcquiredTypesStore = defineStore('market-acquisition', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user