Categories
CMS Magento Mastering Development

On updating product using ASYNC REST API it doesn’t create product in Magento 2

I have using postman to test API to create a product API URL : http://127.0.0.1/magento/rest/async/V1/products Data Passed to test same as documentation : { "product": { "sku": "MS-Champ-S", "name": "Champ Tee Small", "attribute_set_id": 9, "price": 25, "status": 1, "visibility": 1, "type_id": "simple", "weight": "0.5", "extension_attributes": { "category_links": [ { "position": 0, "category_id": "11" }, { […]

Categories
CMS Magento Mastering Development

Magento2 Add Product API With Custom Attributes

I know how to call Add product API in magento2 by default. But here i want to add Option Names Like Maroon , Red Instead of values like 143 , 167 etc. Here is our default Payload { "product": { "sku": "MS-Dime-S", "name": "Dime Tee Small", "attribute_set_id": 9, "price": 25, "status": 1, "visibility": 1, "type_id": […]

Categories
CMS Magento Mastering Development

Why is there another image when uploading via REST API

I am sending a POST request to the upload an Image { "entry": { "media_type": "image", "label": " image", "position": 1, "disabled": false, "types": [ "image", "small_image", "thumbnail" ], "content": { "base64_encoded_data": "My base64 Encoded string", "type": "image/jpeg", "name": "250557" } } } I get a success result , but when I query the image […]

Categories
Mastering Development

Update records in a loop in postgresql efficiently

I have a bunch of records that looks like this: [ CategoryEntity { id: 11, position: 2 }, CategoryEntity { id: 12, position: 1 }, CategoryEntity { id: 13, position: 3 }, CategoryEntity { id: 14, position: 4 }, CategoryEntity { id: 15, position: 5 }, CategoryEntity { id: 17, position: 6 }, CategoryEntity { […]

Categories
Mastering Development

Make a calculated field in mongo db

I have two collections one is Employee and the other one is a salary. I want to make a calculated field in employee collection call monthly salary. How can I access a SALARY from Salary collection and divided by 12? #Here are some info I included in MongoDB. db.Salary.insertMany([ {"POSITION": "1", "BRANCH_SIZE": "HQ", "SALARY": "150000"}, […]

Categories
CMS Mastering Development Wordpress

bp_core_new_subnav_item shows new group tab but returns 404 when the tab runs. Works on another page

I’m trying to add a tab and form to a BuddyPress/BuddyBoss group. I’m able to add the tab, but the page just doesn’t display. I get a 404, and the page logic is never run. What’s strange is this code works for another tab. I’ve tried turning the access to True. I’ve tried a variety […]

Categories
Mastering Development

Plotting in Pandas with columns that have different scales

So I am trying to plot a data set that looks something like this: cat a b c idk 0.47 0.58 1.17 yeet 0.38 0.11 -0.8 skeet 0.03 0.14 0.46 Basically, cat is a categorical variable, a and b are variables which are in a range of [0,1] while c is a variable which ranges […]

Categories
Mastering Development

Rest Assured java.util.HashMap cannot be cast to class java.util.List

I am working on Rest assured framework to automate API testing. actually I want to get the response as list not as an object. cause I want to do assertions for each element. to check data integrity for each element. I am executing this code: List<Category> categories = given(). headers( “Authorization”, “Bearer key”, “Content-Type”, ContentType.JSON, […]

Categories
Mastering Development

How to get array of unique objects with conditions?

I have an array of objects. I need to get an array with unique website name with newest date. Sample data “data” : [ { “position” : 2, “website” : “abc.com”, “owned” : false, “date” : “2020-05-06”, “dateTime” : ISODate(“2020-05-06T00:00:00.000Z”) }, { “position” : 3, “website” : “qwe.com”, “owned” : false, “date” : “2020-05-06”, “dateTime” […]