# all files / keystone/lib/list/ getAdminURL.js

75% Statements 3/4
0% Branches 0/2
0% Functions 0/1
75% Lines 3/4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    171×

    1×

    1×
     var keystone = require('../../');

    /**
     * Gets the Admin URL to view the list (or an item if provided)
     *
     * Example:
     *     var listURL = list.getAdminURL()
     *     var itemURL = list.getAdminURL(item)
     *
     * @param {Object} item
     */
    function getAdminURL (item) {
    	return '/' + keystone.get('admin path') + '/' + this.path + (item ? '/' + item.id : '');
    }

    module.exports = getAdminURL;