[PATCH 1 of 2] follow: Fix args for $.post() call in toggleFollowingRepo()

Mads Kiilerich mads at kiilerich.com
Sat Feb 8 14:05:05 UTC 2020


On 2/8/20 2:06 AM, Ross Thomas wrote:
> # HG changeset patch
> # User Ross Thomas <ross at lns-nevasoft.com>
> # Date 1581112527 28800
> #      Fri Feb 07 13:55:27 2020 -0800
> # Branch stable
> # Node ID f273a7b53fe035c12a55b6a3e34f849af245d797
> # Parent  2571674c4a2fd6247a6dee7d9b4e27df13df1429
> follow: Fix args for $.post() call in toggleFollowingRepo()


Thanks. I do agree this is better. But is it fixing an actual problem? 
The old manual encoding seems to work fine too?

/Mads


> diff -r 2571674c4a2f -r f273a7b53fe0 kallithea/public/js/base.js
> --- a/kallithea/public/js/base.js	Mon Feb 03 20:50:07 2020 +0100
> +++ b/kallithea/public/js/base.js	Fri Feb 07 13:55:27 2020 -0800
> @@ -457,8 +457,10 @@
>   }
>   
>   var toggleFollowingRepo = function(target, follows_repository_id){
> -    var args = 'follows_repository_id=' + follows_repository_id;
> -    args += '&_session_csrf_secret_token=' + _session_csrf_secret_token;
> +    var args = {
> +        'follows_repository_id': follows_repository_id,
> +        '_session_csrf_secret_token': _session_csrf_secret_token
> +    }
>       $.post(TOGGLE_FOLLOW_URL, args, function(data){
>               _onSuccessFollow(target);
>           });
> _______________________________________________
> kallithea-general mailing list
> kallithea-general at sfconservancy.org
> https://lists.sfconservancy.org/mailman/listinfo/kallithea-general




More information about the kallithea-general mailing list