Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dibs 202 posts 991 karma points
    Aug 31, 2020 @ 15:35
    Dibs
    0

    logResource not returning content

    Dear Umbarco Team

    Trying to create custom dashboard in v8.64 following this tutorial on out Umbraco [I know what you did last Tuesday]

    this is my controller file

        angular.module("umbraco").controller("CustomWelcomeDashboardController", function ($scope, userService, logResource) {
        var vm = this;
        vm.UserName = "guest";
        vm.UserLogHistory = [];
    
        var user = userService.getCurrentUser().then(function (user) {
            console.log(user);
            vm.UserName = user.name;
        });
    
        var userLogOptions = {
            pageSize: 10,
            pageNumber: 1,
            orderDirection: "Descending",
            sinceDate: new Date(2018, 0, 1)
        };
    
        logResource.getPagedUserLog(userLogOptions)
            .then(function (response) {
                console.log(response);
                vm.UserLogHistory = response;
            });
    });
    

    this is my view file

    <div class="welcome-dashboard" ng-controller="CustomWelcomeDashboardController as vm">
        <h1>Welcome {{vm.UserName}} to Umbraco</h1>
    
        <h2>We know what you edited last week...</h2>
        <ul>
            <li ng-repeat="logEntry in vm.UserLogHistory.items">{{logEntry.nodeId}} - {{logEntry.logType}} - {{logEntry.timestamp  | date:'medium'}}</li>
        </ul>
    </div>
    

    when viewing console.log to view console.log(response); the array is empty. Im not sure what i am doing wrong ? anyone come across this and able to resolve ?

  • Dibs 202 posts 991 karma points
    Sep 02, 2020 @ 09:29
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies