forked from trent_larson/crowd-funder-for-time-pwa
Fix TypeScript any types, console statements, and clean up duplicates
- Replace console.log with structured logger.debug() calls in AmountInput, GiftDetailsStep, and GiftedDialog components - Fix duplicate enum values in constants/app.ts for LOCAL_*_API_SERVER - Replace Record<string, any> with Record<string, string> for query params - Update error handling from catch(err: any) to catch(err: unknown) - Add EntityData interface and fix entity prop typing - Remove USE_DEXIE_DB conditionals and unused database imports - Fix duplicate imports and class members in GiftedDialog.vue - Correct createAndSubmitGive function call parameters Resolves 12 linting errors and 9 TypeScript any type warnings. Improves type safety, logging practices, and removes deprecated code.
This commit is contained in:
@@ -52,7 +52,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue, Component, Prop, Watch } from "vue-facing-decorator";
|
||||
import { Vue, Component, Prop, Watch } from "vue-facing-decorator";
|
||||
|
||||
import { NotificationIface } from "../constants/app";
|
||||
import {
|
||||
@@ -60,10 +59,9 @@ import {
|
||||
didInfo,
|
||||
serverMessageForUser,
|
||||
getHeaders,
|
||||
getHeaders,
|
||||
} from "../libs/endorserServer";
|
||||
import * as libsUtil from "../libs/util";
|
||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||
// Removed unused imports: db, retrieveSettingsForActiveAccount
|
||||
import { Contact } from "../db/tables/contacts";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import { retrieveAccountDids } from "../libs/util";
|
||||
@@ -101,23 +99,6 @@ export default class GiftedDialog extends Vue {
|
||||
this.updateEntityTypes();
|
||||
}
|
||||
|
||||
@Watch("toProjectId")
|
||||
onToProjectIdChange() {
|
||||
this.updateEntityTypes();
|
||||
}
|
||||
@Prop({ default: false }) showProjects = false;
|
||||
@Prop() isFromProjectView = false;
|
||||
|
||||
@Watch("showProjects")
|
||||
onShowProjectsChange() {
|
||||
this.updateEntityTypes();
|
||||
}
|
||||
|
||||
@Watch("fromProjectId")
|
||||
onFromProjectIdChange() {
|
||||
this.updateEntityTypes();
|
||||
}
|
||||
|
||||
@Watch("toProjectId")
|
||||
onToProjectIdChange() {
|
||||
this.updateEntityTypes();
|
||||
@@ -139,7 +120,7 @@ export default class GiftedDialog extends Vue {
|
||||
receiver?: libsUtil.GiverReceiverInputInfo;
|
||||
unitCode = "HUR";
|
||||
visible = false;
|
||||
|
||||
|
||||
libsUtil = libsUtil;
|
||||
|
||||
projects: PlanData[] = [];
|
||||
@@ -251,7 +232,7 @@ export default class GiftedDialog extends Vue {
|
||||
this.updateEntityTypes();
|
||||
|
||||
try {
|
||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
this.apiServer = settings.apiServer || "";
|
||||
this.activeDid = settings.activeDid || "";
|
||||
|
||||
@@ -377,7 +358,7 @@ export default class GiftedDialog extends Vue {
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Check for person conflict
|
||||
if (this.hasPersonConflict) {
|
||||
this.$notify(
|
||||
@@ -482,18 +463,14 @@ export default class GiftedDialog extends Vue {
|
||||
this.activeDid,
|
||||
fromDid,
|
||||
toDid,
|
||||
fromDid,
|
||||
toDid,
|
||||
description,
|
||||
amount,
|
||||
unitCode,
|
||||
fulfillsProjectHandleId,
|
||||
fulfillsProjectHandleId,
|
||||
this.offerId,
|
||||
false,
|
||||
undefined,
|
||||
providerPlanHandleId,
|
||||
providerPlanHandleId,
|
||||
);
|
||||
|
||||
if (!result.success) {
|
||||
|
||||
Reference in New Issue
Block a user