Advertisement
aivavic

doc

Oct 21st, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Created by viktor on 15.10.2017.
  3.  */
  4. const _documents = [
  5.   {
  6.     id: 1,
  7.     lang: 'ua',
  8.     type: 'policy',
  9.     text: 'policy'
  10.   },
  11.   {
  12.     id: 2,
  13.     lang: 'ua',
  14.     type: 'responsibility',
  15.     text: 'responsibility'
  16.   },
  17.   {
  18.     id: 3,
  19.     lang: 'ua',
  20.     type: 'dispatch',
  21.     text: 'dispatch'
  22.   },
  23.   {
  24.     id: 7,
  25.     lang: 'ua',
  26.     type: 'agreement',
  27.     text: 'agreement text ua'
  28.   },
  29.   {
  30.     id: 4,
  31.     lang: 'ru',
  32.     type: 'policy',
  33.     text: 'policy'
  34.   },
  35.   {
  36.     id: 5,
  37.     lang: 'ru',
  38.     type: 'responsibility',
  39.     text: 'responsibility'
  40.   },
  41.   {
  42.     id: 6,
  43.     lang: 'ru',
  44.     type: 'dispatch',
  45.     text: 'dispatch'
  46.   },
  47.   {
  48.     id: 8,
  49.     lang: 'ru',
  50.     type: 'agreement',
  51.     text: 'agreement text ru'
  52.   }
  53. ]
  54.  
  55. export default {
  56.   getDocument (cb, lang, type) {
  57.     setTimeout(() => {
  58.       cb(_documents.filter(document => document.lang === lang).filter(document => document.type === type))
  59.     }, 100)
  60.   }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement