-
Notifications
You must be signed in to change notification settings - Fork 230
Tags front + back #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tags front + back #411
Conversation
…into tagsFront
| } | ||
|
|
||
| type EditTagsSchema struct { | ||
| TagsToAdd []Tag `json:"tags_to_add"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is edit so why tags to add
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's edit tags of entity - you get an array of tags to add and array of tags to remove - I'll change it to EditTagsListSchema
models/tags.go
Outdated
| } | ||
|
|
||
| type GetTagsByEntityNameSchema struct { | ||
| EntityType string `json:"entity_type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is by name so why type is also a parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema, station and user can all have the same name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this endpoint not in use - I deleted it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this endpoint is still here, should it be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will continue tomorrow.
ui_src/src/domain/stationOverview/stationOverviewHeader/index.js
Outdated
Show resolved
Hide resolved
ui_src/src/domain/stationOverview/stationOverviewHeader/index.js
Outdated
Show resolved
Hide resolved
ui_src/src/domain/stationOverview/stationOverviewHeader/style.scss
Outdated
Show resolved
Hide resolved
ui_src/src/domain/stationOverview/stationOverviewHeader/style.scss
Outdated
Show resolved
Hide resolved
models/tags.go
Outdated
| } | ||
|
|
||
| type GetTagsByEntityNameSchema struct { | ||
| EntityType string `json:"entity_type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this endpoint is still here, should it be?
server/memphis_handlers_tags.go
Outdated
| } | ||
| return nil | ||
| } | ||
| _, err = tagsCollection.UpdateOne(context.TODO(), bson.M{"_id": tag.ID}, bson.M{"$addToSet": bson.M{"stations": entity_id}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use updateOne with upsert intead of calling isExist & createTag.
After changing please ensure everything still works as expected and remove createTag function/isExist function in case no other functions use them
server/memphis_handlers_tags.go
Outdated
| return nil | ||
| } | ||
|
|
||
| func DeleteTagsByStation(id primitive.ObjectID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to deleteTagsFromStation and I think it not has to start with capital letter.
Check all function inside this file and change where needed
server/memphis_handlers_tags.go
Outdated
| } | ||
| } | ||
|
|
||
| func DeleteTagsBySchema(id primitive.ObjectID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to deleteTagsFromSchema
server/memphis_handlers_tags.go
Outdated
| } | ||
| _, err = tagsCollection.UpdateOne(context.TODO(), bson.M{"_id": tag.ID}, | ||
| bson.M{"$pull": bson.M{"stations": station.ID}}) | ||
| _, err = tagsCollection.UpdateOne(context.TODO(), bson.M{"_id": tagToAdd.ID}, bson.M{"$addToSet": bson.M{entityDBList: body.EntityID}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do the same here as we spoke with the upsert
| border-bottom: 2px solid rgba(74, 73, 92, 0.8); | ||
| border-right: 2px solid rgba(74, 73, 92, 0.8); | ||
| } | ||
| .no-checkmark { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talk to me about it
…into tagsFront
No description provided.