2018-12-29 01:27:37 +01:00
|
|
|
/* eslint-disable ember/avoid-leaking-state-in-ember-objects */
|
2023-10-15 23:26:27 +02:00
|
|
|
import { Factory } from 'miragejs';
|
2016-12-19 17:04:09 +01:00
|
|
|
import encrypt from '../utils/encrypt';
|
|
|
|
|
|
|
|
export default Factory.extend({
|
|
|
|
anonymousUser: false,
|
|
|
|
answerType: 'YesNo',
|
|
|
|
creationDate: '2015-04-01T11:11:11.111Z',
|
|
|
|
description: 'default description',
|
|
|
|
encryptionKey: 'abcdefghijklmnopqrstuvwxyz',
|
|
|
|
expirationDate: '',
|
|
|
|
forceAnswer: true,
|
|
|
|
isDateTime: false,
|
|
|
|
options: [
|
|
|
|
{
|
2023-10-15 20:37:03 +02:00
|
|
|
title: '2017-12-24',
|
2016-12-19 17:04:09 +01:00
|
|
|
},
|
|
|
|
{
|
2023-10-15 20:37:03 +02:00
|
|
|
title: '2018-01-01',
|
|
|
|
},
|
2016-12-19 17:04:09 +01:00
|
|
|
],
|
|
|
|
pollType: 'FindADate',
|
|
|
|
title: 'default title',
|
2023-11-04 17:21:35 +01:00
|
|
|
timezone: null,
|
2016-12-19 17:04:09 +01:00
|
|
|
version: 'v0.3',
|
|
|
|
|
|
|
|
afterCreate(poll, server) {
|
|
|
|
let propertiesToEncrypt = [
|
|
|
|
'anonymousUser',
|
|
|
|
'answerType',
|
|
|
|
'creationDate',
|
|
|
|
'description',
|
|
|
|
'expirationDate',
|
|
|
|
'forceAnswer',
|
|
|
|
'options',
|
|
|
|
'pollType',
|
|
|
|
'timezone',
|
2023-10-15 20:37:03 +02:00
|
|
|
'title',
|
2016-12-19 17:04:09 +01:00
|
|
|
];
|
|
|
|
encrypt(propertiesToEncrypt, poll, server);
|
2023-10-15 20:37:03 +02:00
|
|
|
},
|
2016-12-19 17:04:09 +01:00
|
|
|
});
|