mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Add Quick Add Tag functionality and improve tag management in Edit and Publish pages
This commit is contained in:
@@ -330,6 +330,22 @@ class Network {
|
||||
}
|
||||
}
|
||||
|
||||
async getOrCreateTags(names: string[], tagType: string): Promise<Response<Tag[]>> {
|
||||
try {
|
||||
const response = await axios.post(`${this.apiBaseUrl}/tag/batch`, {
|
||||
names,
|
||||
type: tagType
|
||||
})
|
||||
return response.data
|
||||
} catch (e: any) {
|
||||
console.error(e)
|
||||
return {
|
||||
success: false,
|
||||
message: e.toString(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getTagByName(name: string): Promise<Response<Tag>> {
|
||||
try {
|
||||
const response = await axios.get(`${this.apiBaseUrl}/tag/${name}`)
|
||||
|
Reference in New Issue
Block a user