DNNCommunity / DNN.Forum

DNN.Forum
9 stars 7 forks source link

Some PostConnector (public API) improvements #11

Closed roman-yagodin closed 7 years ago

roman-yagodin commented 7 years ago

Some nice things to have in public API:

juvander commented 7 years ago

Need to see, especially this new post id is buried quite deep.

juvander commented 7 years ago

Added another SubmitExternalPost with IsPinned as a new parameter

roman-yagodin commented 7 years ago

Wow, thanks for IsPinned - you are very kind! It will sure help with creating new forum post to discuss from external source!

About new post id: it could be resolved by returning some structure (or class) like that:

public struct SubmitPostResult
{
    public int PostId;
    public PostMessage PostMessage;
}

It can be extended in the future to have more fields to return. But surely it looks like major change in API.

Similar approach could be applied to pass parameters to SubmitExternalPost():

public struct SubmitPostParams
{
    public int TabId;
    public int ModuleId;
    public int ForumId;
    public int UserId;
    ...
    public List<Term> Terms;
}

public SubmitPostResult SubmitExternalPost (SubmitPostParams postParams);
juvander commented 7 years ago

That was my idea as well, but yes, there is lots of places where this is checked. Need to review this carefully.

juvander commented 7 years ago

Did a quick refactoring, see with this https://github.com/juvander/DotNetNuke-Forum/releases/tag/05.01.00_DNN8

roman-yagodin commented 7 years ago

Thanks, I'll check it.

roman-yagodin commented 7 years ago

Seems to work as intended.

juvander commented 7 years ago

Excellent!