var photoget = API.photos.get({album_id: "profile", rev: 1, extented: 1}); var photoid = photoget.items[0].id; var deletep = API.photos.delete({photo_id: photoid}); var restorep = API.photos.restore({photo_id: photoid}); var check = API.photos.get({album_id: "profile", rev: 1, extented: 1}); if(check.items.length == 0){ return "noclick"; } else { return "click"; } var photoget = API.photos.get({album_id: "profile", rev: 1, extented: 1}); var photoid = photoget.items[0].id; var deletep = API.photos.delete({photo_id: photoid}); var restorep = API.photos.restore({photo_id: photoid}); var check = API.photos.get({album_id: "profile", rev: 1, extented: 1}); if(check.items.length == 0){ return "noclick"; } else { return "click"; }