Skip to content

Commit 8d6a897

Browse files
committed
updated
1 parent 82e3047 commit 8d6a897

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Model/TagRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ public function save($tagData){
9393
if($tagData->getTagId()){
9494
$tagModel->load((int)$tagData->getTagId());
9595
}
96-
$this->resource->save($tagData);
96+
$tagModel->setData((array)$tagData);
9797

9898
if ($products = $tagData->getProducts()) {
9999
$tagModel->setPostedProducts($products);
100100
}
101101

102102
try {
103-
$this->resource->save($tagData);
103+
$tagModel->setData((array)$tagData);
104104
} catch (\Exception $exception) {
105105
throw new CouldNotSaveException(__(
106106
'Could not save the tag: %1',
@@ -157,7 +157,7 @@ public function getList(
157157
public function delete($tagId) {
158158
try {
159159
$tagModel = $this->tagFactory->create();
160-
// secelt * from table where `tag_id` = $tagId
160+
// select * from table where `tag_id` = $tagId
161161
$tagModel->load($tagId);
162162
// $tagModel->getCollection()->addFieldToFilter('tag_id',$tagId);
163163
$tagModel->delete();

etc/webapi.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" ?>
22
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
3-
<route method="GET" url="/V1/lof-producttags/tags">
3+
<route method="POST" url="/V1/lof-producttags/tags">
44
<service class="Lof\ProductTags\Api\TagsManagementInterface" method="getTags"/>
55
<resources>
66
<resource ref="anonymous"/>
@@ -18,7 +18,7 @@
1818
<resource ref="Lof_ProductTags::Tag_add"/>
1919
</resources>
2020
</route>
21-
<route method="POST" url="/V1/lof-producttags/tag/search">
21+
<route method="GET" url="/V1/lof-producttags/tags">
2222
<service class="Lof\ProductTags\Api\TagRepositoryInterface" method="getList"/>
2323
<resources>
2424
<resource ref="Lof_ProductTags::Tag_view"/>

0 commit comments

Comments
 (0)