Plugin Directory

Changeset 3064100


Ignore:
Timestamp:
04/03/2024 08:00:07 PM (2 years ago)
Author:
plnic
Message:

updated trunk, currently at v1.4.5

Location:
punchlist/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • punchlist/trunk/bootstrap.php

    r2846365 r3064100  
    66Description: Harness the magic of Punchlist from the WP Dashboard
    77Author: Punchlist Labs
    8 Version: 1.4.4
     8Version: 1.4.5
    99Author URI: https://punchlist.com
    1010Credits: This plugin borrows heavily from Public Post Preview plugin but Dominik Schilling. WP won't allow
     
    1212License: GPLv2
    1313
    14 Copyright (C) 2023 Punchlist Labs Inc.
     14Copyright (C) 2024 Marketwake.
    1515
    1616This program is free software; you can redistribute it and/or
     
    148148            $newProject = $api->createProject($preview->link, $projectName);
    149149           
    150             if ($newProject['data']['share_link']) {
    151                 wp_send_json(['message' => 'success', 'data' => ['url' => $newProject['data']['share_link']]]);
     150            if ($newProject['share_link']) {
     151                wp_send_json(['message' => 'success', 'data' => ['url' => $newProject['share_link']]]);
    152152            } else {
    153153                wp_send_json_error(['message' => 'Error creating project'], 400);
     
    177177
    178178            $pageTitle = sanitize_text_field($_POST['name']) ?: bloginfo('name') . ' ' . date('m-d-Y');
    179             $projectId = is_numeric($_POST['project_id']) ? (int) $_POST['project_id'] : null;
     179            $projectId = $_POST['project_id'];
    180180            $newPage = $api->addPageToProject($preview->link, $projectId, $pageTitle);
    181181         
  • punchlist/trunk/js/plCreateProject.js

    r2825597 r3064100  
    5858        }
    5959      ).fail((err) => {
    60         alert(err.responseJSON.data.message);
     60        console.log(err);
     61        // alert(err.responseJSON.data.message);
    6162      });
    6263    }
  • punchlist/trunk/src/Api.php

    r2825597 r3064100  
    3333    public function createProject($url, $name)
    3434    {
    35         return $this->post('/projects', ['form_params' => ['domain' => $url, 'name' => $name, 'type' => 'web', 'no_proxy' => false]]);
     35        return $this->postJson('/projects', ['domain' => $url, 'name' => $name, 'type' => 'web']);
    3636    }
    3737
     
    7171       
    7272        $url = getenv('PUNCHLIST_URL') . $path;
    73      
    7473        $res = $this->client->request(
    7574            'POST',
     
    7776            $postArgs
    7877        );
    79    
     78       
    8079        $res = json_decode($res->getBody()->getContents(), true);
    8180        return $this->sanitizeResponse($res['data']);
Note: See TracChangeset for help on using the changeset viewer.