added 260907 version of worker toolkit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import Ember from 'ember';
|
||||
import AuthenticatedRouteMixin from 'flaredown/mixins/authenticated-route-mixin';
|
||||
|
||||
const {
|
||||
get,
|
||||
Route,
|
||||
} = Ember;
|
||||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
model() {
|
||||
return get(this, 'store').findAll('pattern');
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import Ember from 'ember';
|
||||
import config from 'flaredown/config/environment';
|
||||
import CryptoJS from 'cryptojs';
|
||||
|
||||
const {
|
||||
get,
|
||||
Route,
|
||||
} = Ember;
|
||||
|
||||
export default Route.extend({
|
||||
secretPhrase: config.encryptionSecret,
|
||||
staticUrl: config.staticUrl,
|
||||
|
||||
model(params) {
|
||||
const friendlyUrl = decodeURIComponent(params.friendly_id);
|
||||
const decryptedArray = CryptoJS.AES.decrypt(friendlyUrl, get(this, 'secretPhrase')).toString(CryptoJS.enc.Utf8);
|
||||
const patternIds = decryptedArray.split(', ').map((id) => id.replace(/\s+/g,""));
|
||||
|
||||
return get(this, 'store').query('pattern', { pattern_ids: patternIds });
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user