Add alert if the pod already made friends
authorChocobozzz <florian.bigard@gmail.com>
Sun, 7 Feb 2016 09:42:55 +0000 (10:42 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Sun, 7 Feb 2016 09:42:55 +0000 (10:42 +0100)
public/javascripts/index.js

index 5d42f02e0b360badf956542f9c57510dc5c236d8..3a02367c866d61c618d394403dc5bb9c5112f669 100644 (file)
       url: '/api/v1/pods/makefriends',
       type: 'GET',
       dataType: 'json',
+      statusCode: {
+        409: function () {
+          alert('Already made friends.')
+        }
+      },
       success: function () {
         alert('Made friends!')
       }