Skip to content

Commit

Permalink
chore: Fix create affiliate submission
Browse files Browse the repository at this point in the history
  • Loading branch information
phuongntt-cystack committed Mar 20, 2024
1 parent 7f66447 commit 8b6d8b7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from locker_server.api_orm.models.wrapper import get_affiliate_submission_model
from locker_server.core.entities.form_submission.affiliate_submission import AffiliateSubmission
from locker_server.core.repositories.affiliate_submission_repository import AffiliateSubmissionRepository
from locker_server.shared.utils.app import now

AffiliateSubmissionORM = get_affiliate_submission_model()
ModelParser = get_model_parser()
Expand Down Expand Up @@ -35,6 +36,9 @@ def get_affiliate_submission_by_id(self, affiliate_submission_id: str) -> Option

# ------------------------ Create AffiliateSubmission resource --------------------- #
def create_affiliate_submission(self, affiliate_submission_create_data) -> Optional[AffiliateSubmission]:
affiliate_submission_create_data.update({
"created_time": now()
})
affiliate_submission_orm = AffiliateSubmissionORM.objects.create(**affiliate_submission_create_data)
return ModelParser.form_submission_parser().parse_affiliate_submission(
affiliate_submission_orm=affiliate_submission_orm
Expand Down

0 comments on commit 8b6d8b7

Please sign in to comment.