/* @flow */

import type { Warning } from '../../../../core/remote/warnings'

module.exports = {
  tosUpdated (): Warning {
    return {
      error: 'tos_updated',
      title: 'TOS Updated',
      details: 'TOS have been updated',
      links: {
        action: 'https://manager.cozycloud.cc/cozy/tos?domain=...'
      }
    }
  },

  list (): Warning[] {
    return [this.tosUpdated()]
  }
}

@@ -96,48 +96,270 @@
 %7B%0A  
-tosUpdated (): W
+list (): %7Bwarnings: Warning%5B%5D, err: Error%7D %7B%0A    const warnings = %5BtosUpdated()%5D%0A    const err = new Error(JSON.stringify(%7Berrors: w
 arning
- %7B%0A    return %7B%0A  
+s%7D))%0A    // $FlowFixMe%0A    err.status = 402%0A%0A    return %7Bwarnings, err%7D%0A  %7D%0A%7D%0A%0Afunction tosUpdated (): Warning %7B%0A  return %7B%0A
     
@@ -373,9 +373,9 @@
 'tos
-_
+-
 upda
@@ -376,26 +376,24 @@
 s-updated',%0A
-  
     title: '
@@ -402,26 +402,24 @@
 S Updated',%0A
-  
     details:
@@ -416,17 +416,16 @@
   detail
-s
 : 'TOS h
@@ -447,18 +447,16 @@
 d',%0A    
-  
 links: %7B
@@ -466,16 +466,12 @@
     
-  action
+self
 : 'h
@@ -527,77 +527,9 @@
     
-  %7D%0A    %7D%0A  %7D,%0A%0A  list (): Warning%5B%5D %7B%0A    return %5Bthis.tosUpdated()%5D
+%7D
 %0A  %7D

Effectively build warnings as an Error