Categories
CMS Mastering Development Wordpress

How to prevent multiple post with same meta value being created simultaneously in WordPress (with ajax)

I’m trying to make my own appointment system for WordPress. For this, I created a post type called "appointments". When users select a service from the service list, the available dates and times are listed. When the available date and time are selected and the appointment is created, a meta key named "appointment_datetime" is added […]

Categories
CMS Mastering Development Wordpress

How to submit the date with ajax?

I have been trying to create an appointment form. Everything else is working but I am not able to submit the date. Here is my code: My HTML for the date field: <input type="date" name="aptdate" class="form-control rounded-pill mr-sm-2" id="aptdate" placeholder="Select a date" onfocus="(this.type=’date’)" onblur="(this.type=’text’)"> My JQuery: jQuery(document).ready(function ($) { /* contact form submission */ $(‘#aptForm’).on(‘submit’, […]

Categories
Mastering Development

How to use IMediator (MediatR) via dependency injection in Umbraco 7 controller with AutoFac?

I have set up dependency injection with Autofac for my umbracp 7.15.3 app based on this example: https://gosudev.com/blog/software-development/umbraco-cms/umbraco-web-api-and-mvc-dependency-injection-with-autofac/ The example works well with the sample controller the same like here: https://github.com/gosudev/UmbracoCMSDIMixedMode/blob/master/src/UmbracoCMSDIMixedMode/UmbracoCMSDIMixedMode.Web/Controllers/Api/SampleWebApiController.cs I need to use other services and am trying to use IMediator (MediatR) so I modified the above controller to: public class SampleWebApiController : […]

Categories
API CSV Development JSON

Writing CSV from JSON returned from API

I am trying to write a CSV file from JSON returned from an API call. I am using pandas, json and requests libraries. response = requests.get(“valid_api_call”) My response.json() looks like this: “request”: { “Target”: “Affiliate_Report”, “Format”: “json”, “Service”: “service”, “Version”: “2”, “api_key”: “key”, “Method”: “getStats”, “fields”: [ “Stat.offer_id”, “Stat.offer_file_id”, “Stat.hour”, “Stat.date”, “Stat.affiliate_info5”, “Stat.affiliate_info4”, “Stat.affiliate_info3”, “Stat.affiliate_info1”, […]