Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #421 from beabee-communityrm/v0.14.x
Browse files Browse the repository at this point in the history
Merge changes from v0.14.x
  • Loading branch information
wpf500 authored May 16, 2024
2 parents b0931c7 + 3021fa6 commit 7b2de71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/api/interceptors/ValidateResponseInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ValidateResponseInterceptor implements InterceptorInterface {
});
}
} catch (errors) {
log.error("Validation failed on response", { errors });
log.notice("Validation failed on response", { errors });
// TODO: Just log error for now
// throw new InternalServerError("Validation failed");
}
Expand Down
16 changes: 11 additions & 5 deletions src/api/utils/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,19 @@ function prepareRule(
}

case "contact":
if (!contact) {
throw new Error("No contact provided to map contact field type");
}
// Map "me" to contact id
return [
simpleField,
rule.value.map((v) => (v === "me" ? contact.id : v))
rule.value.map((v) => {
// Map "me" to contact id
if (v === "me") {
if (!contact) {
throw new Error("No contact provided to map contact field type");
}
return contact.id;
} else {
return v;
}
})
];

default:
Expand Down
14 changes: 7 additions & 7 deletions src/models/Callout.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import {
SetCalloutFormSchema,
CalloutData,
CalloutAccess,
CalloutCaptcha,
CalloutChannel
} from "@beabee/beabee-common";
import {
Column,
CreateDateColumn,
Expand All @@ -12,13 +19,6 @@ import type CalloutTag from "./CalloutTag";
import type CalloutVariant from "./CalloutVariant";

import { CalloutResponseViewSchema } from "@type/index";
import {
SetCalloutFormSchema,
CalloutData,
CalloutAccess,
CalloutCaptcha,
CalloutChannel
} from "@beabee/beabee-common";

@Entity()
export default class Callout extends ItemWithStatus implements CalloutData {
Expand Down

0 comments on commit 7b2de71

Please sign in to comment.