Fix: stepType was being set to an object

This commit is contained in:
Jose Olarte III
2025-07-07 16:20:11 +08:00
parent 114627b218
commit fe0d80eef9
3 changed files with 33 additions and 14 deletions

View File

@@ -564,22 +564,23 @@ export default class GiftedDialog extends Vue {
/**
* Handle entity selection from EntitySelectionStep
* @param entity - The selected entity (person or project)
* @param entity - The selected entity (person or project) with stepType
*/
handleEntitySelected(entity: {
type: "person" | "project";
data: Contact | PlanData;
stepType: string;
}) {
if (entity.type === "person") {
const contact = entity.data as Contact;
if (this.stepType === "giver") {
if (entity.stepType === "giver") {
this.selectGiver(contact);
} else {
this.selectRecipient(contact);
}
} else {
const project = entity.data as PlanData;
if (this.stepType === "giver") {
if (entity.stepType === "giver") {
this.selectProject(project);
} else {
this.selectRecipientProject(project);
@@ -589,10 +590,10 @@ export default class GiftedDialog extends Vue {
/**
* Handle edit entity request from GiftDetailsStep
* @param entityType - 'giver' or 'recipient'
* @param data - Object containing entityType and currentEntity
*/
handleEditEntity(entityType: "giver" | "recipient") {
this.goBackToStep1(entityType);
handleEditEntity(data: { entityType: string; currentEntity: any }) {
this.goBackToStep1(data.entityType);
}
/**