@@ -187,8 +187,8 @@ public Post createPost(Post post, PostStatus status) throws PostCreateException
187187 }
188188
189189 @ Override
190- public Post getCustomPost (Long id , String postTypeName ) throws PostNotFoundException {
191- return getPost (id , postTypeName , Contexts .VIEW );
190+ public Post getCustomPost (Long id , String requestPath ) throws PostNotFoundException {
191+ return getPost (id , requestPath , Contexts .VIEW );
192192 }
193193
194194 @ Override
@@ -348,14 +348,14 @@ public PostMeta getPostMeta(Long postId, Long metaId) {
348348 }
349349
350350 @ Override
351- public List <PostMeta > getCustomPostMetas (Long postId , String customPostType ) {
352- final ResponseEntity <PostMeta []> exchange = doExchange1 (Request .CUSTOM_POST_METAS , HttpMethod .GET , PostMeta [].class , forExpand (customPostType , postId ), null , null );
351+ public List <PostMeta > getCustomPostMetas (Long postId , String requestPath ) {
352+ final ResponseEntity <PostMeta []> exchange = doExchange1 (Request .CUSTOM_POST_METAS , HttpMethod .GET , PostMeta [].class , forExpand (requestPath , postId ), null , null );
353353 return Arrays .asList (exchange .getBody ());
354354 }
355355
356356 @ Override
357- public PostMeta getCustomPostMeta (Long postId , Long metaId , String customPostType ) {
358- final ResponseEntity <PostMeta > exchange = doExchange1 (Request .CUSTOM_POST_META , HttpMethod .GET , PostMeta .class , forExpand (customPostType , postId , metaId ), null , null );
357+ public PostMeta getCustomPostMeta (Long postId , Long metaId , String requestPath ) {
358+ final ResponseEntity <PostMeta > exchange = doExchange1 (Request .CUSTOM_POST_META , HttpMethod .GET , PostMeta .class , forExpand (requestPath , postId , metaId ), null , null );
359359 return exchange .getBody ();
360360 }
361361
@@ -366,12 +366,17 @@ public PostMeta updatePostMetaValue(Long postId, Long metaId, String value) {
366366
367367 @ Override
368368 public PostMeta updatePostMeta (Long postId , Long metaId , String key , String value ) {
369+ return updatePostMeta (postId , metaId , null , value , Request .META );
370+ }
371+
372+ @ Override
373+ public PostMeta updatePostMeta (Long postId , Long metaId , String key , String value , String requestPath ) {
369374 ImmutableMap .Builder <String , Object > builder = new ImmutableMap .Builder <>();
370375 BiConsumer <String , Object > biConsumer = (key1 , value1 ) -> ofNullable (value1 ).ifPresent (v -> builder .put (key1 , v ));
371376
372377 biConsumer .accept (META_KEY , key );
373378 biConsumer .accept (META_VALUE , value );
374- final ResponseEntity <PostMeta > exchange = doExchange1 (Request . META , HttpMethod .POST , PostMeta .class , forExpand (postId , metaId ), null , builder .build ());
379+ final ResponseEntity <PostMeta > exchange = doExchange1 (requestPath , HttpMethod .POST , PostMeta .class , forExpand (postId , metaId ), null , builder .build ());
375380
376381 return exchange .getBody ();
377382 }
0 commit comments